mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-07 20:13:21 +08:00
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:
parent
c318d0e0e4
commit
a8c66bba70
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@ -740,6 +741,12 @@ static void test_generic_listen(const void *test_data)
|
|||||||
goto clean;
|
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();
|
tester_test_passed();
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Loading…
Reference in New Issue
Block a user