Commit a7c7bce2 authored by Tom Cherry's avatar Tom Cherry
Browse files

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
parent 1e2382a0
......@@ -50,7 +50,7 @@ public:
bool isValid() const {
if (m_fdInitialized) {
int status = fcntl(m_fd, F_GETFD, 0);
if (status == 0)
if (status >= 0)
return true;
else
return false;
......@@ -92,7 +92,7 @@ public:
bool isValid() const {
if (m_fdInitialized) {
int status = fcntl(m_fd, F_GETFD, 0);
if (status == 0)
if (status >= 0)
return true;
else
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment