From: thib Date: Sat, 10 Feb 2001 12:53:29 +0000 (+0000) Subject: bug corrected : current dir was not set correctly X-Git-Tag: ver1564~341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d7827d825a24fbce5fc0d447da455a841dcf6ac;p=fcron bug corrected : current dir was not set correctly --- diff --git a/fcrontab.c b/fcrontab.c index c9a0650..5963a71 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrontab.c,v 1.29 2001-01-12 21:41:24 thib Exp $ */ + /* $Id: fcrontab.c,v 1.30 2001-02-10 12:53:29 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.29 2001-01-12 21:41:24 thib Exp $"; +char rcs_info[] = "$Id: fcrontab.c,v 1.30 2001-02-10 12:53:29 thib Exp $"; void info(void); void usage(void); @@ -809,6 +809,10 @@ main(int argc, char **argv) uid = getuid(); + /* get current dir */ + if ( (orig_dir = getcwd(NULL, 0)) == NULL ) + error_e("getcwd"); + /* interpret command line options */ parseopt(argc, argv); @@ -851,10 +855,6 @@ main(int argc, char **argv) * to 600 for security reasons */ umask(026); - /* get current dir */ - if ( (orig_dir = getcwd(NULL, 0)) == NULL ) - error_e("getcwd"); - snprintf(buf, sizeof(buf), "%s.orig", user); /* determine what action should be taken */