diff --git a/pipewire-v4l2/src/pipewire-v4l2.c b/pipewire-v4l2/src/pipewire-v4l2.c index c2f5e1fe6..3d0160ed2 100644 --- a/pipewire-v4l2/src/pipewire-v4l2.c +++ b/pipewire-v4l2/src/pipewire-v4l2.c @@ -764,11 +764,13 @@ static int v4l2_openat(int dirfd, const char *path, int oflag, mode_t mode) } pw_thread_loop_unlock(file->loop); - res = file->fd = spa_system_eventfd_create(file->l->system, + res = spa_system_eventfd_create(file->l->system, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); if (res < 0) goto error; + file->fd = res; + pw_log_info("path:%s oflag:%d mode:%d -> %d (%s)", path, oflag, mode, res, strerror(res < 0 ? errno : 0)); @@ -780,11 +782,13 @@ static int v4l2_openat(int dirfd, const char *path, int oflag, mode_t mode) error_unlock: pw_thread_loop_unlock(file->loop); error: + res = -errno; if (file) free_file(file); pw_log_info("path:%s oflag:%d mode:%d -> %d (%s)", path, oflag, mode, - -1, strerror(errno)); + -1, spa_strerror(res)); + errno = -res; return -1; }