diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-24 00:49:40 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-24 00:57:16 +0200 |
commit | 4213ec5ef9695aa504938c0e764ba9a4f08921b2 (patch) | |
tree | 88ac2b2eb01337f0924d687df38b2a163bc94e11 /src/mail.c | |
parent | 337a06f32fb530e0e0884fef2f5f630cca9911a1 (diff) | |
download | wydawca-4213ec5ef9695aa504938c0e764ba9a4f08921b2.tar.gz wydawca-4213ec5ef9695aa504938c0e764ba9a4f08921b2.tar.bz2 |
Initial implementation of daemon mode.
* gconf/gconf-gram.y (string_to_sockaddr_: Take struct gconf_sockaddr as the
first argument.
* gconf/gconf.h (struct gconf_sockaddr): New data type.
* src/job.c, src/net.c, src/pidfile.c: New files.
* src/Makefile.am (wydawca_SOURCES): Add job.c, net.c, pidfile.c
* src/cmdline.opt: New options: --cron (change semantics), --force,
--foreground, --single-process, --spool
* src/wydawca.c: New daemon mode.
* src/config.c: New statements: spool.alias, daemon, foreground,
single-process, wakeup-interval, pidfile, listen
* src/directive.c, src/diskio.c, src/gpg.c, src/mail.c, src/null.c,
src/process.c, src/triplet.c, src/verify.c, src/vtab.c, src/wydawca.h: use
static struct spool wherever feasible.
* src/triplet.c: New meta-variable "spool"
* tests/etc/wydawca.rcin: Update.
* tests/upload-dry.at: Update.
Diffstat (limited to 'src/mail.c')
-rw-r--r-- | src/mail.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -104,7 +104,10 @@ void | |||
104 | mail_finish () | 104 | mail_finish () |
105 | { | 105 | { |
106 | if (mailer_opened) | 106 | if (mailer_opened) |
107 | mu_mailer_close (mailer); | 107 | { |
108 | mu_mailer_close (mailer); | ||
109 | mailer_opened = 0; | ||
110 | } | ||
108 | } | 111 | } |
109 | 112 | ||
110 | 113 | ||
@@ -269,14 +272,14 @@ get_recipient (struct access_method *method, struct file_triplet *trp, | |||
269 | 272 | ||
270 | if (method->type == method_none) | 273 | if (method->type == method_none) |
271 | { | 274 | { |
272 | *errp = "access method is not configured"; | 275 | *errp = N_("access method is not configured"); |
273 | return NULL; | 276 | return NULL; |
274 | } | 277 | } |
275 | 278 | ||
276 | md = method_open (method); | 279 | md = method_open (method); |
277 | if (!md) | 280 | if (!md) |
278 | { | 281 | { |
279 | *errp = "failed to open access method"; | 282 | *errp = N_("failed to open access method"); |
280 | return NULL; | 283 | return NULL; |
281 | } | 284 | } |
282 | 285 | ||
@@ -289,7 +292,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp, | |||
289 | free (text); | 292 | free (text); |
290 | if (rc) | 293 | if (rc) |
291 | { | 294 | { |
292 | *errp = "cannot obtain recipient emails"; | 295 | *errp = N_("cannot obtain recipient emails"); |
293 | method_close (method, md); | 296 | method_close (method, md); |
294 | return NULL; | 297 | return NULL; |
295 | } | 298 | } |
@@ -299,7 +302,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp, | |||
299 | 302 | ||
300 | if (nrows == 0) | 303 | if (nrows == 0) |
301 | { | 304 | { |
302 | *errp = "cannot obtain recipient emails"; | 305 | *errp = N_("cannot obtain recipient emails"); |
303 | return NULL; | 306 | return NULL; |
304 | } | 307 | } |
305 | 308 | ||
@@ -350,7 +353,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev, | |||
350 | logmsg (LOG_ERR, _("not notifying %s (project %s) about %s: %s"), | 353 | logmsg (LOG_ERR, _("not notifying %s (project %s) about %s: %s"), |
351 | notification_target_str (ntf->tgt), | 354 | notification_target_str (ntf->tgt), |
352 | trp->project, | 355 | trp->project, |
353 | notification_event_str (ev), errp); | 356 | notification_event_str (ev), gettext (errp)); |
354 | return; | 357 | return; |
355 | } | 358 | } |
356 | 359 | ||