Reset SIGTSTP handler to default both for parent and child process.

Submitted by: bde
This commit is contained in:
davidxu 2003-03-11 09:16:51 +00:00
parent 7808f3fb4f
commit 59af771a3e

View File

@ -131,7 +131,7 @@ main(int argc, char *argv[])
char *username, *cleanenv, *class, shellbuf[MAXPATHLEN];
const char *p, *user, *shell, *mytty, **nargv;
struct sigaction sa, sa_int, sa_quit, sa_tstp;
struct sigaction sa, sa_int, sa_quit;
shell = class = cleanenv = NULL;
asme = asthem = fastlogin = statusp = 0;
@ -327,7 +327,9 @@ main(int argc, char *argv[])
sigemptyset(&sa.sa_mask);
sigaction(SIGINT, &sa, &sa_int);
sigaction(SIGQUIT, &sa, &sa_quit);
sa.sa_handler = SIG_DFL;
sigaction(SIGTSTP, &sa, NULL);
statusp = 1;
child_pid = fork();
switch (child_pid) {
@ -356,7 +358,6 @@ main(int argc, char *argv[])
case 0:
sigaction(SIGINT, &sa_int, NULL);
sigaction(SIGQUIT, &sa_quit, NULL);
sigaction(SIGTSTP, &sa_tstp, NULL);
/*
* Set all user context except for: Environmental variables
* Umask Login records (wtmp, etc) Path