plugins: handle some fd allocation errors

This commit is contained in:
Wim Taymans 2026-05-05 11:36:45 +02:00
parent 09dda9e4e0
commit 96594d6716
9 changed files with 20 additions and 0 deletions

View file

@ -1067,6 +1067,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timer_source.data = this;
this->timer_source.fd = spa_system_timerfd_create(this->data_system,
CLOCK_MONOTONIC, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timer_source.fd < 0)
return this->timer_source.fd;
this->timer_source.mask = SPA_IO_IN;
this->timer_source.rmask = 0;

View file

@ -2270,6 +2270,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timerfd = spa_system_timerfd_create(this->data_system,
CLOCK_MONOTONIC, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timerfd < 0)
return this->timerfd;
this->node_latency = 512;

View file

@ -2089,6 +2089,10 @@ impl_init(const struct spa_handle_factory *factory,
this->timerfd = spa_system_timerfd_create(this->data_system,
CLOCK_MONOTONIC, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timerfd < 0) {
res = this->timerfd;
goto fail;
}
return 0;

View file

@ -1042,6 +1042,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timer_source.data = this;
this->timer_source.fd = spa_system_timerfd_create(this->data_system,
this->timer_clockid, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timer_source.fd < 0)
return this->timer_source.fd;
this->timer_source.mask = SPA_IO_IN;
this->timer_source.rmask = 0;

View file

@ -930,6 +930,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timer_source.data = this;
this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC,
SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timer_source.fd < 0)
return this->timer_source.fd;
this->timer_source.mask = SPA_IO_IN;
this->timer_source.rmask = 0;

View file

@ -708,6 +708,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timer_source.data = this;
this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC,
SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timer_source.fd < 0)
return this->timer_source.fd;
this->timer_source.mask = SPA_IO_IN;
this->timer_source.rmask = 0;

View file

@ -767,6 +767,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timer_source.data = this;
this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC,
SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timer_source.fd < 0)
return this->timer_source.fd;
this->timer_source.mask = SPA_IO_IN;
this->timer_source.rmask = 0;

View file

@ -906,6 +906,8 @@ impl_init(const struct spa_handle_factory *factory,
this->timer_source.data = this;
this->timer_source.fd = spa_system_timerfd_create(this->data_system, CLOCK_MONOTONIC,
SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (this->timer_source.fd < 0)
return this->timer_source.fd;
this->timer_source.mask = SPA_IO_IN;
this->timer_source.rmask = 0;

View file

@ -1392,6 +1392,8 @@ static void node_initialized(void *data)
impl->data_source.fd = spa_system_eventfd_create(data_system,
SPA_FD_CLOEXEC | SPA_FD_NONBLOCK);
if (impl->data_source.fd < 0)
return;
spa_loop_add_source(impl->data_loop, &impl->data_source);
pw_log_debug("%p: transport read-fd:%d write-fd:%d", impl,