mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-10 23:50:21 -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
|
|
@ -525,7 +525,7 @@ invalid_version:
|
|||
|
||||
static int listen_start(struct impl *impl)
|
||||
{
|
||||
int fd;
|
||||
int fd, res;
|
||||
|
||||
if (impl->source != NULL)
|
||||
return 0;
|
||||
|
|
@ -534,16 +534,16 @@ static int listen_start(struct impl *impl)
|
|||
|
||||
if ((fd = make_socket((const struct sockaddr *)&impl->src_addr,
|
||||
impl->src_len, impl->ifname)) < 0) {
|
||||
pw_log_error("failed to create socket: %m");
|
||||
pw_log_error("failed to create socket: %s", spa_strerror(fd));
|
||||
return fd;
|
||||
}
|
||||
|
||||
impl->source = pw_loop_add_io(impl->data_loop, fd,
|
||||
SPA_IO_IN, true, on_vban_io, impl);
|
||||
if (impl->source == NULL) {
|
||||
res = -errno;
|
||||
pw_log_error("can't create io source: %m");
|
||||
close(fd);
|
||||
return -errno;
|
||||
return res;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue