summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6eb12b0)
raw | patch | inline | side by side (parent: 6eb12b0)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 7 Jun 2009 14:19:04 +0000 (14:19 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 7 Jun 2009 14:19:04 +0000 (14:19 +0000) |
program/src/rrd_daemon.c | patch | blob | history |
index 53904a331357b2d0a745bb625249191cb26f28c4..f997d3ceddbd4060add089914cf95b80b86b3fcf 100644 (file)
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
}
lseek(pid_fd, 0, SEEK_SET);
- ftruncate(pid_fd, 0);
+ if (ftruncate(pid_fd, 0) == -1)
+ {
+ fprintf(stderr,
+ "FATAL: Faild to truncate stale PID file. (pid %d)\n", pid);
+ close(pid_fd);
+ return -1;
+ }
fprintf(stderr,
"rrdcached: removed stale PID file (no rrdcached on pid %d)\n"
close (0);
open ("/dev/null", O_RDWR);
- dup (0);
- dup (0);
+ if (dup(0) == -1 || dup(0) == -1){
+ RRDD_LOG (LOG_ERR, "faild to run dup.\n");
+ }
} /* if (!stay_foreground) */
/* Change into the /tmp directory. */