mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
handle some error cases
This commit is contained in:
parent
c88f841a58
commit
1c18e8aa69
2 changed files with 6 additions and 3 deletions
|
|
@ -800,8 +800,10 @@ static int v4l2_openat(int dirfd, const char *path, int oflag, mode_t mode)
|
|||
if ((file = find_file_by_dev(dev_id)) != NULL) {
|
||||
res = do_dup(file->fd, 0);
|
||||
unref_file(file);
|
||||
if (res >= 0)
|
||||
fcntl(res, F_SETFL, oflag);
|
||||
if (res < 0)
|
||||
return res;
|
||||
if (fcntl(res, F_SETFL, oflag) < 0)
|
||||
pw_log_warn("fd:%d failed to set flags: %m", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue