[PATCH 2/8] android/tester: Check that fd is valid for Success case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

For the successful test case check that file descriptor is valid through
fcntl which is cheap way.
---
 android/android-tester.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index 3f763d8..2bb7d73 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -17,6 +17,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <fcntl.h>
 
 #include <glib.h>
 #include <sys/socket.h>
@@ -757,6 +758,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:
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux