From: Thibault Godouet Date: Thu, 22 Jun 2000 12:33:09 +0000 (+0000) Subject: fixed the bug when -z was used for a user with no registred fcrontab X-Git-Tag: ver2_9_4~654 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f7123aa6ea8f1a9ed14660254ba6a72f7863149;p=thirdparty%2Ffcron.git fixed the bug when -z was used for a user with no registred fcrontab --- diff --git a/fcrontab.c b/fcrontab.c index c063bc0..f9f9dbe 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrontab.c,v 1.9 2000-06-21 14:59:07 thib Exp $ */ + /* $Id: fcrontab.c,v 1.10 2000-06-22 12:33:09 thib Exp $ */ /* * The goal of this program is simple : giving a user interface to fcron @@ -42,7 +42,7 @@ #include "fcrontab.h" -char rcs_info[] = "$Id: fcrontab.c,v 1.9 2000-06-21 14:59:07 thib Exp $"; +char rcs_info[] = "$Id: fcrontab.c,v 1.10 2000-06-22 12:33:09 thib Exp $"; void info(void); void usage(void); @@ -559,12 +559,17 @@ reinstall(char *buf) explain("reinstalling %s's fcrontab", user); if ( (i = open(buf, O_RDONLY)) < 0) { - if ( errno == ENOENT ) - fprintf(stderr,"Could not reinstall user %s has no fcrontab", buf); + if ( errno == ENOENT ) { + fprintf(stderr, "Could not reinstall: user %s has no fcrontab\n", + buf); + } else fprintf(stderr, "Could not open '%s': %s\n", buf, strerror(errno)); + + exit (EXIT_ERR); } + close(0); dup2(i, 0); close(i);