* Improve messages for rrdcached daemon failed due to PID Exist
New messages added in order to get clarity about the nature of problem
* Review Comment incorporated regarding indentation of error messages
char pid_str[16];
pid_fd = open_pidfile("open", O_RDWR);
- if (pid_fd < 0)
+ if (pid_fd < 0){
+ fprintf(stderr,"FATAL: Fail to create/open PID file \n");
return pid_fd;
+ }
if (read(pid_fd, pid_str, sizeof(pid_str)) <= 0) {
+ fprintf(stderr,"FATAL: Empty PID file exist\n");
close(pid_fd);
return -1;
}
pid = atoi(pid_str);
if (pid <= 0) {
+ fprintf(stderr,"FATAL: PID file is corrupted\n");
+
close(pid_fd);
return -1;
}