Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1755d28
)
callscgi: Exit properly on SIGTERM and SIGINT.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 3 Sep 2010 04:57:12 +0000
(06:57 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 3 Sep 2010 04:57:12 +0000
(06:57 +0200)
src/callscgi.c
patch
|
blob
|
blame
|
history
diff --git
a/src/callscgi.c
b/src/callscgi.c
index
243f323
..
86abb5b
100644
(file)
--- a/
src/callscgi.c
+++ b/
src/callscgi.c
@@
-580,6
+580,11
@@
static void listenloop(struct muth *muth, va_list args)
}
}
+static void sigexit(int sig)
+{
+ exit(0);
+}
+
static void usage(FILE *out)
{
fprintf(out, "usage: servescgi [-h] [-N RETRIES] [-i ID] [-u UNIX-PATH] [-t [HOST:]TCP-PORT] [PROGRAM [ARGS...]]\n");
@@
-617,6
+622,8
@@
int main(int argc, char **argv)
exit(1);
}
signal(SIGCHLD, SIG_IGN);
+ signal(SIGINT, sigexit);
+ signal(SIGTERM, sigexit);
mustart(listenloop, 0);
atexit(killcuraddr);
ioloop();