From: deraadt Date: Sat, 12 Apr 1997 14:51:22 +0000 (+0000) Subject: ign some signals for editor X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba1dd286802c9be676b4dcf4a4eab980e0793ca6;p=openbsd ign some signals for editor --- 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;