Date: Sun, 9 Nov 2008 09:01:09 +0000 (UTC) From: Matteo Riondato <matteo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184784 - head/usr.sbin/cron/crontab Message-ID: <200811090901.mA9919m3035251@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: matteo Date: Sun Nov 9 09:01:09 2008 New Revision: 184784 URL: http://svn.freebsd.org/changeset/base/184784 Log: Revert to previous revision. I should not commit anything at 3.50 AM. In addition to danfe's comments, I got others. I'll work on a better version of the patch. Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 08:39:52 2008 (r184783) +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 09:01:09 2008 (r184784) @@ -63,7 +63,6 @@ static FILE *NewCrontab; static int CheckErrorCount; static enum opt_t Option; static struct passwd *pw; -static char *tmp_path; static void list_cmd(void), delete_cmd(void), edit_cmd(void), @@ -487,16 +486,6 @@ edit_cmd() { } -void -static remove_tmp(int sig) -{ - if (tmp_path) { - unlink(tmp_path); - } - exit(ERROR_EXIT); -} - - /* returns 0 on success * -1 on syntax error * -2 on install error @@ -519,12 +508,6 @@ replace_cmd() { (void) snprintf(n, sizeof(n), "tmp.%d", Pid); (void) snprintf(tn, sizeof(n), CRON_TAB(n)); - /* Set up to remove the temp file if interrupted by a signal. */ - f[0] = signal(SIGHUP, remove_tmp); - f[1] = signal(SIGINT, remove_tmp); - f[2] = signal(SIGTERM, remove_tmp); - tmp_path = tn; - if (!(tmp = fopen(tn, "w+"))) { warn("%s", tn); return (-2); @@ -618,12 +601,6 @@ replace_cmd() { return (-2); } - /* Restore the default signal handlers. */ - tmp_path = NULL; - signal(SIGHUP, f[0]); - signal(SIGINT, f[1]); - signal(SIGTERM, f[2]); - log_it(RealUser, Pid, "REPLACE", User); poke_daemon();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811090901.mA9919m3035251>