projects
/
project
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f8b3c8
)
add an inline function to add the ubus socket to uloop
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 31 Jan 2011 19:00:39 +0000
(20:00 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 31 Jan 2011 19:00:39 +0000
(20:00 +0100)
libubus.h
patch
|
blob
|
history
listener.c
patch
|
blob
|
history
diff --git
a/libubus.h
b/libubus.h
index
5db2992
..
c93ad8f
100644
(file)
--- a/
libubus.h
+++ b/
libubus.h
@@
-131,6
+131,11
@@
void ubus_free(struct ubus_context *ctx);
const char *ubus_strerror(int error);
const char *ubus_strerror(int error);
+static inline void ubus_add_uloop(struct ubus_context *ctx)
+{
+ uloop_fd_add(&ctx->sock, ULOOP_EDGE_TRIGGER | ULOOP_BLOCKING | ULOOP_READ);
+}
+
/* ----------- raw request handling ----------- */
/* wait for a request to complete and return its status */
/* ----------- raw request handling ----------- */
/* wait for a request to complete and return its status */
diff --git
a/listener.c
b/listener.c
index
188cda8
..
0111f09
100644
(file)
--- a/
listener.c
+++ b/
listener.c
@@
-74,7
+74,7
@@
int main(int argc, char **argv)
fprintf(stderr, "Object Type ID: %08x\n", test_object2.type->id);
}
uloop_init();
fprintf(stderr, "Object Type ID: %08x\n", test_object2.type->id);
}
uloop_init();
- u
loop_fd_add(&ctx->sock, ULOOP_READ | ULOOP_EDGE_TRIGGER
);
+ u
bus_add_uloop(ctx
);
uloop_run();
ubus_free(ctx);
uloop_run();
ubus_free(ctx);