mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-07-02 00:06:09 -04:00
modules: loop_add_io with close=true owns the fd
We should not close the fd when loop_add_io with close=true fails because the fd is already closed.
This commit is contained in:
parent
eec372ba9d
commit
8907d0860b
6 changed files with 9 additions and 20 deletions
|
|
@ -1197,10 +1197,8 @@ static int setup_apple_session(struct impl *impl)
|
|||
impl->ctrl_source = pw_loop_add_io(impl->loop, fd,
|
||||
SPA_IO_IN, true, on_ctrl_io, impl);
|
||||
|
||||
if (impl->ctrl_source == NULL) {
|
||||
close(fd);
|
||||
if (impl->ctrl_source == NULL)
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if ((fd = make_socket(&impl->data_addr, impl->data_len,
|
||||
impl->mcast_loop, impl->ttl, impl->ifname)) < 0)
|
||||
|
|
@ -1208,10 +1206,8 @@ static int setup_apple_session(struct impl *impl)
|
|||
|
||||
impl->data_source = pw_loop_add_io(impl->data_loop, fd,
|
||||
SPA_IO_IN, true, on_data_io, impl);
|
||||
if (impl->data_source == NULL) {
|
||||
close(fd);
|
||||
if (impl->data_source == NULL)
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue