diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-27 14:31:35 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-27 14:31:35 +0000 |
commit | 4172149f89b14c2760578f6dc99427794f83de2b (patch) | |
tree | 0c37368e3ac708aa90d33474a97ef178d299c226 /package/uhttpd/src/uhttpd-utils.c | |
parent | 27d3adb4507f8c9940075de097b83a9bf776566b (diff) | |
download | upstream-4172149f89b14c2760578f6dc99427794f83de2b.tar.gz upstream-4172149f89b14c2760578f6dc99427794f83de2b.tar.bz2 upstream-4172149f89b14c2760578f6dc99427794f83de2b.zip |
uhttpd: block SIGCHLD until it is expected (#6957)
SVN-Revision: 20513
Diffstat (limited to 'package/uhttpd/src/uhttpd-utils.c')
-rw-r--r-- | package/uhttpd/src/uhttpd-utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/package/uhttpd/src/uhttpd-utils.c b/package/uhttpd/src/uhttpd-utils.c index c1e08b0695..55b2c410e3 100644 --- a/package/uhttpd/src/uhttpd-utils.c +++ b/package/uhttpd/src/uhttpd-utils.c @@ -88,6 +88,25 @@ char *strfind(char *haystack, int hslen, const char *needle, int ndlen) return NULL; } +/* interruptable select() */ +int select_intr(int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t) +{ + int rv; + sigset_t ssn, sso; + + /* unblock SIGCHLD */ + sigemptyset(&ssn); + sigaddset(&ssn, SIGCHLD); + sigprocmask(SIG_UNBLOCK, &ssn, &sso); + + rv = select(n, r, w, e, t); + + /* restore signal mask */ + sigprocmask(SIG_SETMASK, &sso, NULL); + + return rv; +} + int uh_tcp_send(struct client *cl, const char *buf, int len) { |