moved signal handlers before port binding
This commit is contained in:
parent
1301be6ce8
commit
c19e5e6724
1 changed files with 8 additions and 8 deletions
16
quark.c
16
quark.c
|
@ -383,6 +383,14 @@ main(int argc, char *argv[]) {
|
|||
if(!(gpwd = getpwnam(group)))
|
||||
die("error: invalid group %s\n", group);
|
||||
|
||||
signal(SIGCHLD, sighandler);
|
||||
signal(SIGHUP, sighandler);
|
||||
signal(SIGINT, sighandler);
|
||||
signal(SIGQUIT, sighandler);
|
||||
signal(SIGABRT, sighandler);
|
||||
signal(SIGTERM, sighandler);
|
||||
signal(SIGKILL, sighandler);
|
||||
|
||||
/* init */
|
||||
setbuf(stdout, NULL); /* unbuffered stdout */
|
||||
memset(&hints, 0, sizeof hints);
|
||||
|
@ -416,14 +424,6 @@ main(int argc, char *argv[]) {
|
|||
die("error: location too long\n");
|
||||
}
|
||||
|
||||
signal(SIGCHLD, sighandler);
|
||||
signal(SIGHUP, sighandler);
|
||||
signal(SIGINT, sighandler);
|
||||
signal(SIGQUIT, sighandler);
|
||||
signal(SIGABRT, sighandler);
|
||||
signal(SIGTERM, sighandler);
|
||||
signal(SIGKILL, sighandler);
|
||||
|
||||
if(chroot(docroot) == -1)
|
||||
die("error: chroot %s: %s\n", docroot, strerror(errno));
|
||||
|
||||
|
|
Loading…
Reference in a new issue