android/tester: Check that fd is valid for Success case

For the successful test case check that file descriptor is valid through
fcntl which is cheap way.
This commit is contained in:
Andrei Emeltchenko 2013-12-12 17:17:48 +02:00 committed by Johan Hedberg
parent c318d0e0e4
commit a8c66bba70

View File

@ -17,6 +17,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <glib.h>
#include <sys/socket.h>
@ -740,6 +741,12 @@ static void test_generic_listen(const void *test_data)
goto clean;
}
/* Check that file descriptor is valid */
if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) == -1) {
tester_test_failed();
return;
}
tester_test_passed();
clean: