From ba1dd286802c9be676b4dcf4a4eab980e0793ca6 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 12 Apr 1997 14:51:22 +0000 Subject: [PATCH] ign some signals for editor --- usr.sbin/cron/crontab.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c index 31c5814620a..10c946bcb7e 100644 --- a/usr.sbin/cron/crontab.c +++ b/usr.sbin/cron/crontab.c @@ -16,7 +16,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: crontab.c,v 1.9 1997/04/12 09:39:58 deraadt Exp $"; +static char rcsid[] = "$Id: crontab.c,v 1.10 1997/04/12 14:51:22 deraadt Exp $"; #endif /* crontab - install and manage per-user crontab files @@ -394,6 +394,10 @@ edit_cmd() { * close and reopen the file around the edit. */ + /* Turn off signals. */ + (void)signal(SIGHUP, SIG_IGN); + (void)signal(SIGINT, SIG_IGN); + (void)signal(SIGQUIT, SIG_IGN); switch (pid = fork()) { case -1: perror("fork"); @@ -445,6 +449,9 @@ edit_cmd() { } else break; } + (void)signal(SIGHUP, SIG_DFL); + (void)signal(SIGINT, SIG_DFL); + (void)signal(SIGQUIT, SIG_DFL); if (fstat(t, &statbuf) < 0) { perror("fstat"); goto fatal; -- 2.20.1