projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d110a01
)
uloop: fix infinite waiting with kqueue
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 6 Dec 2010 00:16:59 +0000
(
01:16
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 6 Dec 2010 00:16:59 +0000
(
01:16
+0100)
uloop.c
patch
|
blob
|
history
diff --git
a/uloop.c
b/uloop.c
index
4d4b223
..
ec37925
100644
(file)
--- a/
uloop.c
+++ b/
uloop.c
@@
-116,15
+116,12
@@
static void uloop_run_events(int timeout)
struct timespec ts;
int nfds, n;
struct timespec ts;
int nfds, n;
- if (timeout < 0) {
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
- } else {
+ if (timeout > 0) {
ts.tv_sec = timeout / 1000;
ts.tv_nsec = timeout * 1000000;
}
ts.tv_sec = timeout / 1000;
ts.tv_nsec = timeout * 1000000;
}
- nfds = kevent(poll_fd, NULL, 0, events, ARRAY_SIZE(events),
&ts
);
+ nfds = kevent(poll_fd, NULL, 0, events, ARRAY_SIZE(events),
timeout > 0 ? &ts : NULL
);
for(n = 0; n < nfds; ++n)
{
struct uloop_fd *u = events[n].udata;
for(n = 0; n < nfds; ++n)
{
struct uloop_fd *u = events[n].udata;