From faebfe2e0769c7b1a5cf357ca8165b35653c432f Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 5 Jun 2000 20:08:50 +0000 Subject: [PATCH] Kill yourself in ^C handler, not exit(1) to allow script to sense signal --- bin/ls/print.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/ls/print.c b/bin/ls/print.c index 8d47501e2e8..1cdbf4f4d1c 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -46,11 +46,6 @@ static const char rcsid[] = #include #include -#ifdef COLORLS -#include -#include -#include /* for tparm */ -#endif #include #include #include @@ -61,6 +56,12 @@ static const char rcsid[] = #include #include #include +#ifdef COLORLS +#include +#include +#include /* for tparm */ +#include +#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*/