diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2014-08-29 16:12:55 -0700 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2014-09-06 23:17:36 -0700 |
commit | 12e9e3557979af218ddb40f1e221d7fc56596fe9 (patch) | |
tree | 5c3a72696b774fbab4b87363b269a0a1da986e4d | |
parent | b72f4cf77edb1975cada8aab5ae63361c68c5992 (diff) | |
download | libusb-12e9e3557979af218ddb40f1e221d7fc56596fe9.tar.gz |
io: Move timerfd close into error handling path
This makes error handling consistent with other areas. This is a
follow-on change to commit b72f4cf77edb1975cada8aab5ae63361c68c5992.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r-- | libusb/io.c | 9 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libusb/io.c b/libusb/io.c index eb6f41b..2bc122c 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -1147,10 +1147,8 @@ int usbi_io_init(struct libusb_context *ctx) if (ctx->timerfd >= 0) { usbi_dbg("using timerfd for timeouts"); r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN); - if (r < 0) { - close(ctx->timerfd); - goto err_remove_hp_pipe; - } + if (r < 0) + goto err_close_timerfd; } else { usbi_dbg("timerfd not available (code %d error %d)", ctx->timerfd, errno); ctx->timerfd = -1; @@ -1160,7 +1158,8 @@ int usbi_io_init(struct libusb_context *ctx) return 0; #ifdef USBI_TIMERFD_AVAILABLE -err_remove_hp_pipe: +err_close_timerfd: + close(ctx->timerfd); usbi_remove_pollfd(ctx, ctx->hotplug_pipe[0]); #endif err_close_hp_pipe: diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 6841c9c..4b584fa 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10917 +#define LIBUSB_NANO 10918 |