util: fix clobbered errno in sink_add_source

This commit is contained in:
Peter Hutterer 2023-10-10 10:37:35 +10:00
parent 381c6bea1f
commit 8f6c355805

View file

@ -197,9 +197,10 @@ sink_add_source(struct sink *sink, struct source *source)
.data.ptr = source_ref(source),
};
if (epoll_ctl(sink->epollfd, EPOLL_CTL_ADD, source_get_fd(source), &e) < 0) {
int rc = xerrno(epoll_ctl(sink->epollfd, EPOLL_CTL_ADD, source_get_fd(source), &e));
if (rc < 0) {
source_unref(source);
return -errno;
return rc;
}
source->is_active = true;