mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
v4l2: fix some compiler warnings
Compare poiters with NULL and without ordering.
This commit is contained in:
parent
bb23fd787e
commit
ed9d3e7320
1 changed files with 8 additions and 7 deletions
|
|
@ -793,9 +793,10 @@ static int v4l2_openat(int dirfd, const char *requested_path, int oflag, mode_t
|
||||||
struct file *file;
|
struct file *file;
|
||||||
bool passthrough = true;
|
bool passthrough = true;
|
||||||
uint32_t dev_id = SPA_ID_INVALID;
|
uint32_t dev_id = SPA_ID_INVALID;
|
||||||
|
char *path;
|
||||||
|
|
||||||
char *path = realpath(requested_path, NULL);
|
path = realpath(requested_path, NULL);
|
||||||
if (path <= 0)
|
if (path == NULL)
|
||||||
path = (char *)requested_path;
|
path = (char *)requested_path;
|
||||||
|
|
||||||
if (spa_strstartswith(path, "/dev/video")) {
|
if (spa_strstartswith(path, "/dev/video")) {
|
||||||
|
|
@ -881,7 +882,7 @@ static int v4l2_openat(int dirfd, const char *requested_path, int oflag, mode_t
|
||||||
add_dev_for_serial(file->dev_id, file->serial);
|
add_dev_for_serial(file->dev_id, file->serial);
|
||||||
unref_file(file);
|
unref_file(file);
|
||||||
|
|
||||||
if (path > 0 && path != requested_path)
|
if (path != NULL && path != requested_path)
|
||||||
free(path);
|
free(path);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -895,11 +896,11 @@ error:
|
||||||
|
|
||||||
pw_log_info("path:%s oflag:%d mode:%d -> %d (%s)", path, oflag, mode,
|
pw_log_info("path:%s oflag:%d mode:%d -> %d (%s)", path, oflag, mode,
|
||||||
-1, spa_strerror(res));
|
-1, spa_strerror(res));
|
||||||
|
|
||||||
|
if (path != NULL && path != requested_path)
|
||||||
|
free(path);
|
||||||
|
|
||||||
errno = -res;
|
errno = -res;
|
||||||
|
|
||||||
if (path > 0 && path != requested_path)
|
|
||||||
free(path);
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue