diff options
author | Tom Cherry | 2015-11-05 12:07:53 -0600 |
---|---|---|
committer | Tom Cherry | 2015-11-05 12:07:53 -0600 |
commit | a7c7bce252a6bce1539e9caa84420de3698029e7 (patch) | |
tree | e9118ab62eaecc0309cc2daf9a70736de15d8074 /libsync | |
parent | 1e2382a0277eb36fb57a3a54202945556dfd234b (diff) | |
download | platform-system-core-a7c7bce252a6bce1539e9caa84420de3698029e7.tar.gz platform-system-core-a7c7bce252a6bce1539e9caa84420de3698029e7.tar.xz platform-system-core-a7c7bce252a6bce1539e9caa84420de3698029e7.zip |
Fix isValid() condition for libsync tests
Upstream modifications in K3.12 to the sw_sync driver set O_CLOEXEC on
the fd's returned by the SW_SYNC_IOC_CREATE_FENCE ioctl, therefore we
check the return of fcntl() for a non-negative value instead of strictly 0.
Change-Id: If4c82750fcc0aa3a57f243fa2a94691e3150e4a4
Diffstat (limited to 'libsync')
-rw-r--r-- | libsync/tests/sync_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libsync/tests/sync_test.cpp b/libsync/tests/sync_test.cpp index 55cd68773..2c409dc27 100644 --- a/libsync/tests/sync_test.cpp +++ b/libsync/tests/sync_test.cpp | |||
@@ -50,7 +50,7 @@ public: | |||
50 | bool isValid() const { | 50 | bool isValid() const { |
51 | if (m_fdInitialized) { | 51 | if (m_fdInitialized) { |
52 | int status = fcntl(m_fd, F_GETFD, 0); | 52 | int status = fcntl(m_fd, F_GETFD, 0); |
53 | if (status == 0) | 53 | if (status >= 0) |
54 | return true; | 54 | return true; |
55 | else | 55 | else |
56 | return false; | 56 | return false; |
@@ -92,7 +92,7 @@ public: | |||
92 | bool isValid() const { | 92 | bool isValid() const { |
93 | if (m_fdInitialized) { | 93 | if (m_fdInitialized) { |
94 | int status = fcntl(m_fd, F_GETFD, 0); | 94 | int status = fcntl(m_fd, F_GETFD, 0); |
95 | if (status == 0) | 95 | if (status >= 0) |
96 | return true; | 96 | return true; |
97 | else | 97 | else |
98 | return false; | 98 | return false; |