filter-graph: handle fcntl errors better

Don't set invalid flags when the F_GETFL failed.
This commit is contained in:
Wim Taymans 2026-05-06 12:47:44 +02:00
parent fed4d14ab7
commit 8276d615ba

View file

@ -3114,8 +3114,11 @@ static void *pipe_instantiate(const struct spa_fga_plugin *plugin, const struct
do_exec(impl, command);
fcntl(impl->write_fd, F_SETFL, fcntl(impl->write_fd, F_GETFL) | O_NONBLOCK);
fcntl(impl->read_fd, F_SETFL, fcntl(impl->read_fd, F_GETFL) | O_NONBLOCK);
int flags;
if ((flags = fcntl(impl->write_fd, F_GETFL)) >= 0)
fcntl(impl->write_fd, F_SETFL, flags | O_NONBLOCK);
if ((flags = fcntl(impl->read_fd, F_GETFL)) >= 0)
fcntl(impl->read_fd, F_SETFL, flags | O_NONBLOCK);
return impl;
}