Tidy up uc_iomux_waker_init

This commit is contained in:
Nils O. Selåsdal
2015-11-28 21:51:19 +01:00
parent 9416c58457
commit c9aff6f910
+5 -8
View File
@@ -70,17 +70,14 @@ int uc_iomux_waker_init(struct IOMux *mux, struct IOMuxWaker *wk, uc_waker_cb cb
rc = uc_set_nonblocking(pfds[1]);
assert(rc == 0);
if (uc_install_wake_handler(wk, pfds[0]) == 0) {
return 0;
} else {
int saved_errno;
saved_errno = errno;
rc = uc_install_wake_handler(wk, pfds[0]);
if (rc != 0) {
rc = errno;
close(pfds[0]);
close(pfds[1]);
return saved_errno;
}
return rc;
}
int uc_iomux_waker_destroy(struct IOMuxWaker *wk)