C utility functions for OpenWRT libraries
Find a file
Kristian Evensen 13a9b7c709 Restore signal handler after uloop_run()
uloop_run calls uloop_setup_signals() to set up signal handling before the while
loop, but does not remove the signal handling after the loop has ended. This can
cause problems for for example applications using the ubus file descriptor in
their own event loops, and perhaps with their own signal handling.

This patch stores the signal handle that was in place when the initial
uloop_run() call was made, and restores the handle when this call returns.
For recursive calls, the signal handler is not updated.

One use-case I experienced was an application that subscribed to several ubus
objects and used the ubus file descriptor in its own event loop. Even though
ubus_register_subscriber() (which calls uloop_run()) had returned, the signal
handler was not removed. This caused SIGINT not to be caught by the application.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-22 17:26:05 +02:00
examples blobmsg-example: fix length handling in dump_table() calls 2013-09-11 17:59:33 +02:00
lua add declarations for lua{open,close}_uloop to avoid warnings 2012-10-22 20:03:36 +02:00
sh jshn: add json_get_keys() 2013-10-20 00:00:42 +02:00
.gitignore add a cmake file for the examples and add the binaries to .gitignore 2012-10-21 23:01:30 +02:00
avl-cmp.c add avl_strcmp 2012-05-26 18:01:18 +02:00
avl-cmp.h add avl_strcmp 2012-05-26 18:01:18 +02:00
avl.c make __avl_find_element() inline 2011-02-06 18:01:37 +01:00
avl.h avl: fix type handling in container_of uses 2013-03-18 05:53:44 +01:00
blob.c blob: add a magic offset to nesting cookies to ensure that NULL is never returned as a normal value 2013-10-16 01:22:02 +02:00
blob.h blob: add a magic offset to nesting cookies to ensure that NULL is never returned as a normal value 2013-10-16 01:22:02 +02:00
blobmsg.c blob: add a magic offset to nesting cookies to ensure that NULL is never returned as a normal value 2013-10-16 01:22:02 +02:00
blobmsg.h blobmsg: add blobmsg_len() for consistency (similar to blob_len) 2013-10-20 13:19:51 +02:00
blobmsg_json.c blobmsg_json: allow signed output of integers 2013-10-04 16:55:45 +02:00
blobmsg_json.h blobmsg_json: add blobmsg_add_json_from_file 2013-05-29 12:14:48 +02:00
CMakeLists.txt runqueue: add a simple task queueing/completion tracking implementation 2013-05-09 01:10:00 +02:00
jshn.c jshn: add support for the double datatype 2013-03-17 00:50:03 +01:00
json_script.c json_script: do not rely on global includes for other libubox header files 2013-03-02 16:21:11 +01:00
json_script.h json_script: do not rely on global includes for other libubox header files 2013-03-02 16:21:11 +01:00
list.h list.h: implement type safety for container_of() 2013-03-18 05:55:00 +01:00
list_compat.h list_compat.h: add copyright info 2013-01-13 09:49:16 +01:00
runqueue.c runqueue should cal the complete handler from more places 2013-07-02 18:33:46 +02:00
runqueue.h runqueue: move completion handler from runqueue_process to runqueue_task to make it more generic 2013-05-09 01:27:45 +02:00
safe_list.c safe_list: add missing null pointer check in safe_list_del() 2013-06-28 13:05:06 +02:00
safe_list.h safe_list: add safe_list_empty() 2013-04-15 15:53:57 +02:00
uloop.c Restore signal handler after uloop_run() 2013-10-22 17:26:05 +02:00
uloop.h uloop: fix corner cases with recursive uloop_run calls 2013-06-18 12:05:09 +02:00
usock.c add license headers for usock 2013-01-13 15:27:38 +01:00
usock.h add license headers for usock 2013-01-13 15:27:38 +01:00
ustream-fd.c ustream: only report stream eof once via state_change callback 2013-05-31 11:18:26 +02:00
ustream.c ustream: properly clear fields to fix ustream reuse 2013-10-19 18:20:03 +02:00
ustream.h ustream: another fix for ustream_read_buf_full() with split read buffers 2013-01-31 18:10:52 +01:00
utils.c uloop: add a clock_gettime() implementation for mac os x 2013-01-06 02:42:58 +01:00
utils.h utils: add bitfield inline ops 2013-06-10 13:37:14 +02:00
vlist.c vlist: constify key argument to vlist_add 2013-10-05 21:40:04 +02:00
vlist.h vlist: constify key argument to vlist_add 2013-10-05 21:40:04 +02:00