From 078e97678e79cb61347b8d952c7ce9d665a3de8e Mon Sep 17 00:00:00 2001 From: thib Date: Mon, 1 Mar 2010 09:11:46 +0000 Subject: [PATCH] Fixed compilation warnings --- doc/Makefile.in | 2 +- fcron.c | 9 ++++++--- fcrontab.c | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/Makefile.in b/doc/Makefile.in index dc24d7c..08762be 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -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 9133753..90bd5cf 100644 --- 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(); diff --git a/fcrontab.c b/fcrontab.c index bd57a61..cb265bd 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -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; -- 2.49.0