diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-01-26 13:48:34 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-01-26 13:48:34 +0000 |
commit | 594e5f5cccebdde93f349605998486280aca311c (patch) | |
tree | 78cb3795ea1e719a4bd0983963852e0a58c97098 | |
parent | 2fce3d14de6bfd91076a514d4c13c809b17511d5 (diff) | |
download | mailutils-594e5f5cccebdde93f349605998486280aca311c.tar.gz mailutils-594e5f5cccebdde93f349605998486280aca311c.tar.bz2 |
Use mu_error instead of fprintf
-rw-r--r-- | mail.remote/mail.remote.c | 31 | ||||
-rw-r--r-- | readmsg/readmsg.c | 13 |
2 files changed, 22 insertions, 22 deletions
diff --git a/mail.remote/mail.remote.c b/mail.remote/mail.remote.c index d8b952bbf..611345a35 100644 --- a/mail.remote/mail.remote.c +++ b/mail.remote/mail.remote.c @@ -72,7 +72,7 @@ N_("GNU mail.remote -- pseudo-sendmail interface for mail delivery\n" "the data part of the protocol transaction will also be printed to stdout.\n"); static struct argp_option options[] = { - {"from", 'f', N_("ADDR"), 0, N_("Override the default from address\n")}, + {"from", 'f', N_("ADDR"), 0, N_("Override the default from address")}, {"debug", 'd', NULL, 0, N_("Enable debugging output")}, { 0, 'o', "OPT", OPTION_HIDDEN, N_("Ignored for sendmail compatibility")}, {0} @@ -148,8 +148,8 @@ main (int argc, char **argv) { if ((status = address_create (&from, optfrom))) { - fprintf (stderr, _("Parsing from addresses failed: %s\n"), - mu_strerror (status)); + mu_error (_("Parsing from addresses failed: %s"), + mu_strerror (status)); goto end; } } @@ -160,34 +160,33 @@ main (int argc, char **argv) if ((status = address_createv (&to, (const char **) av, -1))) { - fprintf (stderr, _("Parsing to addresses failed: %s\n"), - mu_strerror (status)); + mu_error (_("Parsing to addresses failed: %s"), + mu_strerror (status)); goto end; } } if ((status = stdio_stream_create (&in, stdin, MU_STREAM_SEEKABLE))) { - fprintf (stderr, _("Failed: %s\n"), mu_strerror (status)); + mu_error (_("Failed: %s"), mu_strerror (status)); goto end; } if ((status = stream_open (in))) { - fprintf (stderr, _("Opening stdin failed: %s\n"), mu_strerror (status)); + mu_error (_("Opening stdin failed: %s"), mu_strerror (status)); goto end; } if ((status = message_create (&msg, NULL))) { - fprintf (stderr, _("Failed: %s\n"), mu_strerror (status)); + mu_error (_("Failed: %s"), mu_strerror (status)); goto end; } if ((status = message_set_stream (msg, in, NULL))) { - fprintf (stderr, _("Failed: %s\n"), - mu_strerror (status)); + mu_error (_("Failed: %s"), mu_strerror (status)); goto end; } @@ -195,8 +194,8 @@ main (int argc, char **argv) { const char *url = NULL; mailer_get_url_default (&url); - fprintf (stderr, _("Creating mailer '%s' failed: %s\n"), - url, mu_strerror (status)); + mu_error (_("Creating mailer '%s' failed: %s"), + url, mu_strerror (status)); goto end; } @@ -214,20 +213,20 @@ main (int argc, char **argv) { const char *url = NULL; mailer_get_url_default (&url); - fprintf (stderr, _("Opening mailer '%s' failed: %s\n"), - url, mu_strerror (status)); + mu_error (_("Opening mailer '%s' failed: %s"), + url, mu_strerror (status)); goto end; } if ((status = mailer_send_message (mailer, msg, from, to))) { - fprintf (stderr, _("Sending message failed: %s\n"), mu_strerror (status)); + mu_error (_("Sending message failed: %s"), mu_strerror (status)); goto end; } if ((status = mailer_close (mailer))) { - fprintf (stderr, _("Closing mailer failed: %s\n"), mu_strerror (status)); + mu_error (_("Closing mailer failed: %s"), mu_strerror (status)); goto end; } diff --git a/readmsg/readmsg.c b/readmsg/readmsg.c index f5809fd2d..79775d81d 100644 --- a/readmsg/readmsg.c +++ b/readmsg/readmsg.c @@ -243,7 +243,8 @@ main (int argc, char **argv) status = mailbox_create_default (&mbox, mailbox_name); if (status != 0) { - fprintf (stderr, _("could not create - %s\n"), mu_strerror(status)); + mu_error (_("could not create mailbox: %s"), + mu_strerror(status)); exit (2); } @@ -261,9 +262,9 @@ main (int argc, char **argv) url_t url = NULL; mailbox_get_url (mbox, &url); - fprintf (stderr, _("can't open mailbox %s: %s\n"), - url_to_string (url), - mu_strerror(status)); + mu_error (_("can't open mailbox %s: %s"), + url_to_string (url), + mu_strerror(status)); exit (2); } @@ -282,8 +283,8 @@ main (int argc, char **argv) status = mailbox_get_message (mbox, set[i], &msg); if (status != 0) { - fprintf (stderr, "mailbox_get_message - %s\n", - mu_strerror (status)); + mu_error ("mailbox_get_message: %s", + mu_strerror (status)); exit (2); } |