]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
fixed the bug when -z was used for a user with no registred fcrontab
authorThibault Godouet <yo8192@users.noreply.github.com>
Thu, 22 Jun 2000 12:33:09 +0000 (12:33 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Thu, 22 Jun 2000 12:33:09 +0000 (12:33 +0000)
fcrontab.c

index c063bc02697be985176ef67da3acf59f5c711b99..f9f9dbe21a569807976bcaa3240391f712774cb4 100644 (file)
@@ -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);