aboutsummaryrefslogtreecommitdiff
path: root/src/wydawca.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-12-22 21:39:23 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-12-22 21:54:43 +0200
commit67a64a6a7809c183516740696e15ab88f82d7ef0 (patch)
treeb58f30a8cee98bac7c9f4bc8236c86eefdadb4ef /src/wydawca.c
parent2c28190e77ce38b6437a2be8337680f77f58d37a (diff)
downloadwydawca-67a64a6a7809c183516740696e15ab88f82d7ef0.tar.gz
wydawca-67a64a6a7809c183516740696e15ab88f82d7ef0.tar.bz2
Implement inotify support.
* configure.ac: New option --with-inotify. Bye default, use inotify if it is present. * src/watcher.c: New file. Implements inotify watcher. * src/Makefile.am [COND_INOTIFY] (wydawca_SOURCES): Add watcher.c * src/diskio.c (dir_get_path): New function. * src/job.c (job) <spool>: Remove const qualifier. All uses changed. (inotify_spool): New pseudo-spool. (fake_spool): Remove static qualifier. (wydawca_scanner): Support for inotify spools. * src/net.c (open_listener): Don't exit if the listener address is not set. (wydawca_listener): Listen on the listener socket and on the inotify descriptor. If none is set, bail out. * src/process.c (for_each_spool) (file_info_cleanup) (spool_cwd_add_new_file,spool_add_new_file): New functions. (scan_spool_unlocked): Use spool_cwd_add_new_file. Don't initialize dictionaries here: it will be done in spool_commit_triplets. (spool_open_dictionaries): New function. (close_dictionaries): Rename to spool_close_dictionaries. Clear dict_inited. * src/triplet.c (hash_triplet_compare): Compare spools as well. (register_file): Likewise. (triplet_lookup): New function. (check_triplet_state): New argument: noauth. All uses updated. (enumerate_triplets): Rename to spool_commit_triplets. Call spool_open_dictionaries. (count_processable_triplets,triplet_remove_file): New functions. * src/verify.c (verify_directive_file): New argument: noauth. All uses updated. * src/vtab.c (reg): Initialize get_path member. (get_path): New function. * src/wydawca.c (main): Set print_version_hook. * src/wydawca.h (virt_tab) <get_path>: New method. (spool) <dict_inited>: New member. (fake_spool, inotify_spool): New externs. (spool_add_new_file, spool_cwd_add_new_file) (spool_open_dictionaries, spool_close_dictionaries) (for_each_spool, count_processable_triplets) (triplet_remove_file, get_path): New protos. (enumerate_triplets): Rename to spool_commit_triplets. (verify_directive_file): Take two arguments.
Diffstat (limited to 'src/wydawca.c')
-rw-r--r--src/wydawca.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wydawca.c b/src/wydawca.c
index 69fb898..521d796 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -328,6 +328,19 @@ wydawca_daemon ()
328 328
329#include "cmdline.h" 329#include "cmdline.h"
330 330
331void
332version_hook (FILE *stream)
333{
334 printf ("Compiled with:");
335#ifdef WITH_LIBWRAP
336 printf (" libwrap");
337#endif
338#ifdef WITH_INOTIFY
339 printf (" inotify");
340#endif
341 putchar ('\n');
342}
343
331int 344int
332main (int argc, char **argv) 345main (int argc, char **argv)
333{ 346{
@@ -335,6 +348,7 @@ main (int argc, char **argv)
335 const char *p; 348 const char *p;
336 349
337 program_name = argv[0]; 350 program_name = argv[0];
351 print_version_hook = version_hook;
338 mu_register_all_mailer_formats (); 352 mu_register_all_mailer_formats ();
339 mu_stdstream_setup (MU_STDSTREAM_RESET_NONE); 353 mu_stdstream_setup (MU_STDSTREAM_RESET_NONE);
340 config_init (); 354 config_init ();

Return to:

Send suggestions and report system problems to the System administrator.