Skip to content

Commit

Permalink
Use vperror to print error messages related to pid file problems
Browse files Browse the repository at this point in the history
  • Loading branch information
austvik authored and dustin committed Feb 22, 2010
1 parent 7fc4fcc commit d3094ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -4169,13 +4169,13 @@ static void save_pid(const pid_t pid, const char *pid_file) {
return;

if ((fp = fopen(pid_file, "w")) == NULL) {
fprintf(stderr, "Could not open the pid file %s for writing\n", pid_file);
vperror("Could not open the pid file %s for writing", pid_file);
return;
}

fprintf(fp,"%ld\n", (long)pid);
if (fclose(fp) == -1) {
fprintf(stderr, "Could not close the pid file %s.\n", pid_file);
vperror("Could not close the pid file %s", pid_file);
return;
}
}
Expand All @@ -4185,7 +4185,7 @@ static void remove_pidfile(const char *pid_file) {
return;

if (unlink(pid_file) != 0) {
fprintf(stderr, "Could not remove the pid file %s.\n", pid_file);
vperror("Could not remove the pid file %s", pid_file);
}

}
Expand Down

0 comments on commit d3094ed

Please sign in to comment.