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>
20 #ifdef USBI_TIMERFD_AVAILABLE
22 #include <sys/timerfd.h>
25 @@ -1141,7 +1142,7 @@ int usbi_io_init(struct libusb_context *
27 #ifdef USBI_TIMERFD_AVAILABLE
28 ctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(),
31 if (ctx->timerfd >= 0) {
32 usbi_dbg("using timerfd for timeouts");
33 r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN);