mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-06 11:33:28 +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 <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:
|
||||
|
Loading…
Reference in New Issue
Block a user