projects
/
oweals
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
869fc39
)
uloop: add a flag for keeping the socket blocking
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 6 Dec 2010 15:54:13 +0000
(16:54 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 6 Dec 2010 15:54:13 +0000
(16:54 +0100)
uloop.c
patch
|
blob
|
history
uloop.h
patch
|
blob
|
history
diff --git
a/uloop.c
b/uloop.c
index ec37925a672a3d9a857f5274932f2ea74d595a44..a263a01c5f3ed457d54dcbebdcea45f8ea92d934 100644
(file)
--- a/
uloop.c
+++ b/
uloop.c
@@
-236,7
+236,7
@@
int uloop_fd_add(struct uloop_fd *sock, unsigned int flags)
unsigned int fl;
int ret;
- if (!sock->registered) {
+ if (!sock->registered
&& !(flags & ULOOP_BLOCKING)
) {
fl = fcntl(sock->fd, F_GETFL, 0);
fl |= O_NONBLOCK;
fcntl(sock->fd, F_SETFL, fl);
diff --git
a/uloop.h
b/uloop.h
index 35ee3a5e4c71dfa787aa73a7eaa6894db7e9ad90..10a117f1ecd70ae77a01747781fec7173b574bb1 100644
(file)
--- a/
uloop.h
+++ b/
uloop.h
@@
-39,6
+39,7
@@
typedef void (*uloop_timeout_handler)(struct uloop_timeout *t);
#define ULOOP_READ (1 << 0)
#define ULOOP_WRITE (1 << 1)
#define ULOOP_EDGE_TRIGGER (1 << 2)
+#define ULOOP_BLOCKING (1 << 3)
struct uloop_fd
{