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
@@ -101,13 +101,16 @@ mail_send_message (mu_address_t rcpt, const char *text) } void mail_finish () { if (mailer_opened) - mu_mailer_close (mailer); + { + mu_mailer_close (mailer); + mailer_opened = 0; + } } struct message_template { char *name; @@ -266,43 +269,43 @@ get_recipient (struct access_method *method, struct file_triplet *trp, char *text; int rc; void *md; if (method->type == method_none) { - *errp = "access method is not configured"; + *errp = N_("access method is not configured"); return NULL; } md = method_open (method); if (!md) { - *errp = "failed to open access method"; + *errp = N_("failed to open access method"); return NULL; } make_default_meta (def, trp->user, trp->project); meta_escape (method, md, def); text = meta_expand_string (method->query, def, NULL); meta_free (def); rc = method_run (method, md, text); free (text); if (rc) { - *errp = "cannot obtain recipient emails"; + *errp = N_("cannot obtain recipient emails"); method_close (method, md); return NULL; } nrows = method_num_rows (method); ncols = method_num_cols (method); if (nrows == 0) { - *errp = "cannot obtain recipient emails"; + *errp = N_("cannot obtain recipient emails"); return NULL; } for (i = 0; i < nrows; i++) { mu_address_t addr; @@ -347,13 +350,13 @@ do_notify (struct file_triplet *trp, enum notification_event ev, if (!rcpt) { logmsg (LOG_ERR, _("not notifying %s (project %s) about %s: %s"), notification_target_str (ntf->tgt), trp->project, - notification_event_str (ev), errp); + notification_event_str (ev), gettext (errp)); return; } if (debug_level) { size_t size; |