diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-04-18 14:53:46 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-04-18 14:53:46 +0300 |
commit | 7c8140491ce8547fe45a791fb0a185817b5ff8ec (patch) | |
tree | 079f04ba8448930c9bc926bd7d2d71a5efa3b04f /src/wydawca.c | |
parent | 1c754c175e78d36aec8c4437d5a024169445f798 (diff) | |
download | wydawca-7c8140491ce8547fe45a791fb0a185817b5ff8ec.tar.gz wydawca-7c8140491ce8547fe45a791fb0a185817b5ff8ec.tar.bz2 |
Remove spool locking
* NEWS: Document changes.
* doc/wydawca.texi: Document changes.
* src/Makefile.am: Remove lock.c
* src/lock.c: Delete.
* src/config.c: Remove the locking statement.
* tests/etc/wydawca.cfin: Likewise.
* src/wydawca.c: Check pidfile before startup, unless in dry-run mode.
* src/wydawca.h: Remove prototypes of locking functions
* src/process.c (scan_spool_unlocked): Merge into
scan_spool.
* src/timer.c (struct timer_slot): Use reference counter instead
of timer state
Diffstat (limited to 'src/wydawca.c')
-rw-r--r-- | src/wydawca.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/wydawca.c b/src/wydawca.c index 5c7d5d7..31ca52d 100644 --- a/src/wydawca.c +++ b/src/wydawca.c @@ -262,20 +262,6 @@ grecs_print_diag(grecs_locus_t * locus, int err, int errcode, } } -void -wydawca_daemon() -{ - if (!foreground) { - if (daemon(0, 0)) { - wy_log(LOG_ERR, "%s", strerror(errno)); - exit(EX_OSERR); - } - wy_log(LOG_NOTICE, _("daemon launched")); - } - - check_pidfile(); -} - #include "cmdline.h" void @@ -331,7 +317,13 @@ wy_main(void) scan_all_spools(); if (wy_mode == WY_MODE_DAEMON) { - wydawca_daemon(); + if (!foreground) { + if (daemon(0, 0)) { + wy_log(LOG_ERR, "%s", strerror(errno)); + exit(EX_OSERR); + } + wy_log(LOG_NOTICE, _("daemon launched")); + } // Start cleaner thread pthread_create(&tid, NULL, wy_thr_cleaner, NULL); @@ -454,12 +446,12 @@ main(int argc, char **argv) exit(EX_UNAVAILABLE); } - wydawca_lock_init(); - wy_log(LOG_NOTICE, _("wydawca (%s) started"), PACKAGE_STRING); + if (!wy_dry_run) + check_pidfile(); wy_main(); - + dictionaries_close(); modules_close(); remove_pidfile(); |