mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 23:05:49 +01:00
Kill yourself in ^C handler, not exit(1) to allow script to sense signal
This commit is contained in:
parent
47bb6b11f3
commit
faebfe2e07
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61294
@ -46,11 +46,6 @@ static const char rcsid[] =
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef COLORLS
|
||||
#include <ctype.h>
|
||||
#include <termcap.h>
|
||||
#include <term.h> /* for tparm */
|
||||
#endif
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fts.h>
|
||||
@ -61,6 +56,12 @@ static const char rcsid[] =
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#ifdef COLORLS
|
||||
#include <ctype.h>
|
||||
#include <termcap.h>
|
||||
#include <term.h> /* for tparm */
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include "ls.h"
|
||||
#include "extern.h"
|
||||
@ -463,12 +464,14 @@ char *cs;
|
||||
}
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void colorquit(sig)
|
||||
int sig;
|
||||
{
|
||||
endcolor();
|
||||
exit(1);
|
||||
fflush(stdout);
|
||||
|
||||
(void) signal(sig, SIG_DFL);
|
||||
(void) kill(getpid(), sig);
|
||||
}
|
||||
#endif /*COLORLS*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user