Assume SIGTSTP is defined

It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2022-12-02 23:02:24 +01:00 committed by Serge Hallyn
parent 74c8015730
commit 307502d8b5
4 changed files with 1 additions and 14 deletions

View File

@ -42,21 +42,16 @@ void login_prompt (const char *prompt, char *name, int namesize)
FILE *fp;
sighandler_t sigquit;
#ifdef SIGTSTP
sighandler_t sigtstp;
#endif
/*
* There is a small chance that a QUIT character will be part of
* some random noise during a prompt. Deal with this by exiting
* instead of core dumping. If SIGTSTP is defined, do the same
* thing for that signal.
* instead of core dumping. Do the same thing for SIGTSTP.
*/
sigquit = signal (SIGQUIT, login_exit);
#ifdef SIGTSTP
sigtstp = signal (SIGTSTP, login_exit);
#endif
/*
* See if the user has configured the issue file to
@ -148,8 +143,6 @@ void login_prompt (const char *prompt, char *name, int namesize)
*/
(void) signal (SIGQUIT, sigquit);
#ifdef SIGTSTP
(void) signal (SIGTSTP, sigtstp);
#endif
}

View File

@ -49,9 +49,7 @@ void pwd_init (void)
signal (SIGPIPE, SIG_IGN);
signal (SIGQUIT, SIG_IGN);
signal (SIGTERM, SIG_IGN);
#ifdef SIGTSTP
signal (SIGTSTP, SIG_IGN);
#endif
#ifdef SIGTTOU
signal (SIGTTOU, SIG_IGN);
#endif

View File

@ -133,9 +133,7 @@ int main (int argc, char **argv)
(void) signal (SIGHUP, catch_signals);
(void) signal (SIGINT, catch_signals);
(void) signal (SIGQUIT, catch_signals);
#ifdef SIGTSTP
(void) signal (SIGTSTP, catch_signals);
#endif
/*
* expiry takes one of two arguments. The default action is to give

View File

@ -1145,9 +1145,7 @@ int main (int argc, char **argv)
(void) signal (SIGINT, catch_signals);
(void) signal (SIGQUIT, catch_signals);
(void) signal (SIGTERM, catch_signals);
#ifdef SIGTSTP
(void) signal (SIGTSTP, catch_signals);
#endif
/* Prompt for the new password */
#ifdef SHADOWGRP