handle some error cases
This commit is contained in:
parent
c88f841a58
commit
1c18e8aa69
|
@ -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) {
|
if ((file = find_file_by_dev(dev_id)) != NULL) {
|
||||||
res = do_dup(file->fd, 0);
|
res = do_dup(file->fd, 0);
|
||||||
unref_file(file);
|
unref_file(file);
|
||||||
if (res >= 0)
|
if (res < 0)
|
||||||
fcntl(res, F_SETFL, oflag);
|
return res;
|
||||||
|
if (fcntl(res, F_SETFL, oflag) < 0)
|
||||||
|
pw_log_warn("fd:%d failed to set flags: %m", res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,8 @@ static void node_param(void *data, int seq,
|
||||||
{
|
{
|
||||||
uint32_t media_type, media_subtype;
|
uint32_t media_type, media_subtype;
|
||||||
|
|
||||||
spa_format_parse(param, &media_type, &media_subtype);
|
if (spa_format_parse(param, &media_type, &media_subtype) < 0)
|
||||||
|
goto done;
|
||||||
|
|
||||||
switch(media_type) {
|
switch(media_type) {
|
||||||
case SPA_MEDIA_TYPE_audio:
|
case SPA_MEDIA_TYPE_audio:
|
||||||
|
|
Loading…
Reference in New Issue