]> granicus.if.org Git - fcron/commitdiff
Fixed compilation warnings
authorthib <thib@berseker.(none)>
Mon, 1 Mar 2010 09:11:46 +0000 (09:11 +0000)
committerthib <thib@berseker.(none)>
Mon, 1 Mar 2010 09:11:46 +0000 (09:11 +0000)
doc/Makefile.in
fcron.c
fcrontab.c

index dc24d7cc9578c68d8cafe3c7602b94ea8bd00287..08762be8006f6521a7d301701ee2b04c553d7ceb 100644 (file)
@@ -42,7 +42,7 @@ LANGUAGES = en fr
 
 # this is a regular expression:
 # do not ci these files
-RCSNOCI=.*\(bitstring.3\|fcron-doc.ced\|Makefile\|${STYLESHEET}\|fcron-doc.mod\|HTML.*\|txt.*\|man\/.*\|CVS.*\)
+RCSNOCI=.*\(bitstring.3\|fcron-doc.ced\|Makefile\|${STYLESHEET}\|fcron-doc.mod\|HTML.*\|txt.*\|man\/.*\|CVS.*\|.git.*\)
 
 all: doc
 
diff --git a/fcron.c b/fcron.c
index 9133753547205b9e8f263d00923e2918b0528f01..90bd5cfcceb54fc84ef563babfdc1c6f242578d1 100644 (file)
--- a/fcron.c
+++ b/fcron.c
@@ -528,7 +528,8 @@ main(int argc, char **argv)
        die_e("Could not change dir to %s", fcrontabs);
     
 
-    freopen("/dev/null", "r", stdin);
+    if ( freopen("/dev/null", "r", stdin) == NULL )
+        error_e("Could not open /dev/null as stdin");
 
     if (foreground == 0) {
 
@@ -562,8 +563,10 @@ main(int argc, char **argv)
            close(fd);
        }
        
-       freopen("/dev/null", "w", stdout);
-       freopen("/dev/null", "w", stderr);
+        if ( freopen("/dev/null", "w", stdout) == NULL )
+            error_e("Could not open /dev/null as stdout");
+        if ( freopen("/dev/null", "w", stderr) == NULL )
+            error_e("Could not open /dev/null as stderr");
 
        /* close most other open fds */
        xcloselog();
index bd57a61ff80fb7e17486c380d97f1b2bc72e35e1..cb265bdefa106fccb4d2f77ca40c49c26c1291e8 100644 (file)
@@ -525,7 +525,8 @@ edit_file(char *fcron_orig)
                }
            }
            snprintf(editorcmd, sizeof(editorcmd), "%s %s", cureditor, tmp_str);
-           chdir(tmp_path);
+           if ( chdir(tmp_path) != 0 )
+                error_e("Could not chdir to %s", tmp_path);
            execlp(shell, shell, "-c", editorcmd, tmp_str, NULL);
            error_e("Error while running \"%s\"", cureditor);
            goto exiterr;