diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-24 18:45:51 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-24 18:45:51 +0200 |
commit | c9178a6fef0184baed0e8456bb6c6d4091b4997c (patch) | |
tree | 0c97d7aeb6235a469cd071d7d0b589f45a9d35f6 /src/pidfile.c | |
parent | b1472caae9a1b6905b6bbe42e69539b29febcf5c (diff) | |
download | wydawca-c9178a6fef0184baed0e8456bb6c6d4091b4997c.tar.gz wydawca-c9178a6fef0184baed0e8456bb6c6d4091b4997c.tar.bz2 |
Implement locking
* src/lock.c: New file.
* gnulib.modules (sysexits, xgethostname): New modules.
* src/lock.c: New file.
* src/Makefile.am: Add lock.c
* src/config.c: Locking keywords.
* src/job.c: Requeue jobs if locking fails.
* src/wydawca.c (wydawca_uid): Rename to wydawca_set_uid
(main): Implement restart.
* src/process.c (scan_spool, scan_all_spools): Use locking, if configured.
* src/directive.c, src/diskio.c, src/triplet.c: Rename
wydawca_uid
* src/exec.c, src/getopt.m4, src/net.c,
src/pidfile.c: Use standard error codes from sysexits.h
* tests/etc/wydawca.rcin: Disable locking.
Diffstat (limited to 'src/pidfile.c')
-rw-r--r-- | src/pidfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pidfile.c b/src/pidfile.c index 484cabd..6da84f1 100644 --- a/src/pidfile.c +++ b/src/pidfile.c @@ -38,7 +38,7 @@ check_pidfile () { logmsg (LOG_ERR, _("malformed pidfile %s"), pidfile); if (!force_startup) - exit (1); + exit (EX_UNAVAILABLE); } else { @@ -50,7 +50,7 @@ check_pidfile () _("cannot verify if PID %lu is running: %s"), pid, strerror (errno)); if (!force_startup) - exit (1); + exit (EX_UNAVAILABLE); } } else if (!force_startup) @@ -58,7 +58,7 @@ check_pidfile () logmsg (LOG_ERR, _("another wydawca instance may be running (PID %lu)"), pid); - exit (1); + exit (EX_UNAVAILABLE); } } logmsg (LOG_NOTICE, _("replacing pidfile %s (PID %lu)"), @@ -69,7 +69,7 @@ check_pidfile () { logmsg (LOG_ERR, _("cannot open pidfile %s: %s"), pidfile, strerror (errno)); - exit (1); + exit (EX_UNAVAILABLE); } else { @@ -79,7 +79,7 @@ check_pidfile () logmsg (LOG_ERR, _("cannot open pidfile %s for writing: %s"), pidfile, strerror (errno)); - exit (1); + exit (EX_UNAVAILABLE); } } fprintf (fp, "%lu\n", getpid ()); |