1 commit cadb77d99e314e42c3eb02d016e9d90136ec6959
2 Author: Alexander Gordeev <lasaine@lvk.cs.msu.su>
3 Date: Thu Jan 27 06:39:16 2011 +0300
5 fix timerfd initialization
7 sys/timerfd.h defines TFD_NONBLOCK as 0x800 but in kernel TFD_NONBLOCK
8 is an alias for O_NONBLOCK which is defined in arch-specific fcntl.h.
9 While it's still 0x800 for most of archs but for mips it's 0x80. So
10 timerfd_create(..., TFD_NONBLOCK) returns -EINVAL because of that. Fix
11 this by using O_NONBLOCK instead.
13 Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
15 diff --git a/libusb/io.c b/libusb/io.c
16 index 1379eb3..250b8dc 100644
27 @@ -1025,7 +1026,7 @@ int usbi_io_init(struct libusb_context *ctx)
29 #ifdef USBI_TIMERFD_AVAILABLE
30 ctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(),
33 if (ctx->timerfd >= 0) {
34 usbi_dbg("using timerfd for timeouts");
35 r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN);