diff options
Diffstat (limited to 'src/v4l2/v4l2_compat_manager.cpp')
-rw-r--r-- | src/v4l2/v4l2_compat_manager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp index 2338a0ee..56533c4f 100644 --- a/src/v4l2/v4l2_compat_manager.cpp +++ b/src/v4l2/v4l2_compat_manager.cpp @@ -155,12 +155,17 @@ int V4L2CompatManager::openat(int dirfd, const char *path, int oflag, mode_t mod if (ret < 0) return ret; - int efd = eventfd(0, oflag & (O_CLOEXEC | O_NONBLOCK)); + int efd = eventfd(0, EFD_SEMAPHORE | + ((oflag & O_CLOEXEC) ? EFD_CLOEXEC : 0) | + ((oflag & O_NONBLOCK) ? EFD_NONBLOCK : 0)); if (efd < 0) { + int err = errno; proxy->close(); + errno = err; return efd; } + proxy->bind(efd); devices_.emplace(efd, proxy); return efd; |