diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-03-10 23:25:11 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-03-10 23:26:52 +0200 |
commit | 39a97e438dde837ada9a99cceea93a1cf97db19e (patch) | |
tree | efc492dcfcdc2c21bfdec5c31692b348601cd94a /src/pidfile.c | |
parent | 87602f5492b842f734dffe22f4e2f85dbc6ce713 (diff) | |
download | wydawca-39a97e438dde837ada9a99cceea93a1cf97db19e.tar.gz wydawca-39a97e438dde837ada9a99cceea93a1cf97db19e.tar.bz2 |
Provide a convenient debugging macro.
Rename logmsg to wy_log.
Diffstat (limited to 'src/pidfile.c')
-rw-r--r-- | src/pidfile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pidfile.c b/src/pidfile.c index eda5ba9..afac10f 100644 --- a/src/pidfile.c +++ b/src/pidfile.c @@ -33,13 +33,13 @@ check_pidfile() if (fp) { unsigned long pid = -1; if (fscanf(fp, "%lu\n", &pid) != 1) { - logmsg(LOG_ERR, _("malformed pidfile %s"), pidfile); + wy_log(LOG_ERR, _("malformed pidfile %s"), pidfile); if (!force_startup) exit(EX_UNAVAILABLE); } else { if (kill(pid, 0)) { if (errno != ESRCH) { - logmsg(LOG_ERR, + wy_log(LOG_ERR, _("cannot verify if PID %lu " "is running: %s"), pid, strerror(errno)); @@ -47,24 +47,24 @@ check_pidfile() exit(EX_UNAVAILABLE); } } else if (!force_startup) { - logmsg(LOG_ERR, + wy_log(LOG_ERR, _("another wydawca instance may " "be running (PID %lu)"), pid); exit(EX_UNAVAILABLE); } } - logmsg(LOG_NOTICE, _("replacing pidfile %s (PID %lu)"), + wy_log(LOG_NOTICE, _("replacing pidfile %s (PID %lu)"), pidfile, pid); fseek(fp, 0, SEEK_SET); } else if (errno != ENOENT) { - logmsg(LOG_ERR, _("cannot open pidfile %s: %s"), pidfile, + wy_log(LOG_ERR, _("cannot open pidfile %s: %s"), pidfile, strerror(errno)); exit(EX_UNAVAILABLE); } else { fp = fopen(pidfile, "w"); if (!fp) { - logmsg(LOG_ERR, + wy_log(LOG_ERR, _("cannot open pidfile %s for writing: %s"), pidfile, strerror(errno)); exit(EX_UNAVAILABLE); |