mirror of https://gerrit.osmocom.org/libosmocore
timerfd: call osmo_fd_unregister() when closing on read error
Change-Id: I8513126286083ebf02d14043cf072c8297878dd7
This commit is contained in:
parent
06747d5720
commit
100e44ed49
|
@ -382,6 +382,7 @@ int osmo_timerfd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, unsigned
|
|||
|
||||
rc = osmo_fd_register(ofd);
|
||||
if (rc < 0) {
|
||||
osmo_fd_unregister(ofd);
|
||||
close(ofd->fd);
|
||||
ofd->fd = -1;
|
||||
return rc;
|
||||
|
|
Loading…
Reference in New Issue