1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

[package] uhttpd: block SIGCHLD until it is expected (#6957)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20513 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow
2010-03-27 14:31:35 +00:00
parent f52ddee30b
commit f5b350a276
6 changed files with 33 additions and 4 deletions

View File

@@ -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)
{