Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Comply better with the CGI specification by unquoting PATH_INFO.
[ashd.git]
/
src
/
patplex.c
diff --git
a/src/patplex.c
b/src/patplex.c
index
d296e04
..
3b3d7f9
100644
(file)
--- a/
src/patplex.c
+++ b/
src/patplex.c
@@
-24,6
+24,7
@@
#include <errno.h>
#include <ctype.h>
#include <regex.h>
#include <errno.h>
#include <ctype.h>
#include <regex.h>
+#include <sys/wait.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@
-438,7
+439,7
@@
static void serve(struct hthead *req, int fd)
return;
}
return;
}
- if(childhandle(ch, req, fd))
+ if(childhandle(ch, req, fd
, NULL, NULL
))
simpleerror(fd, 500, "Server Error", "The request handler crashed.");
}
simpleerror(fd, 500, "Server Error", "The request handler crashed.");
}
@@
-464,6
+465,15
@@
static void reloadconf(char *nm)
lconfig = cf;
}
lconfig = cf;
}
+static void chldhandler(int sig)
+{
+ pid_t pid;
+
+ do {
+ pid = waitpid(-1, NULL, WNOHANG);
+ } while(pid > 0);
+}
+
static void sighandler(int sig)
{
if(sig == SIGHUP)
static void sighandler(int sig)
{
if(sig == SIGHUP)
@@
-511,8
+521,9
@@
int main(int argc, char **argv)
flog(LOG_ERR, "could not read `%s'", argv[optind]);
exit(1);
}
flog(LOG_ERR, "could not read `%s'", argv[optind]);
exit(1);
}
- signal(SIGCHLD,
SIG_IGN
);
+ signal(SIGCHLD,
chldhandler
);
signal(SIGHUP, sighandler);
signal(SIGHUP, sighandler);
+ signal(SIGPIPE, sighandler);
while(1) {
if(reload) {
reloadconf(argv[optind]);
while(1) {
if(reload) {
reloadconf(argv[optind]);