Commit d55106d9 d55106d93b386f3d7bb1870875d8fc8227ee5a07 by Sam Roberts

Replaced strerror() with mu_errstring().

1 parent c003ad7d
......@@ -435,21 +435,21 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
|| (status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
syslog (LOG_ERR, "can't open mailbox %s: %s",
path, strerror (status));
path, mu_errstring (status));
return;
}
if ((status = mailbox_get_stream (mbox, &stream)))
{
syslog (LOG_ERR, "can't get stream for mailbox %s: %s",
path, strerror (status));
path, mu_errstring (status));
return;
}
if ((status = stream_size (stream, (off_t *) &size)))
{
syslog (LOG_ERR, "can't get stream size (mailbox %s): %s",
path, strerror (status));
path, mu_errstring (status));
return;
}
......@@ -462,18 +462,18 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
stream_read (stream, blurb, size, offset, &n);
blurb[size] = 0;
if (mailbox_create (&tmp, "/dev/null") != 0
|| mailbox_open (tmp, MU_STREAM_READ) != 0)
if ((status = mailbox_create (&tmp, "/dev/null")) != 0
|| (status = mailbox_open (tmp, MU_STREAM_READ)) != 0)
{
syslog (LOG_ERR, "can't create temporary mailbox: %s",
strerror (status));
mu_errstring (status));
return;
}
if ((status = memory_stream_create (&stream, 0, 0)))
{
syslog (LOG_ERR, "can't create temporary stream: %s",
strerror (status));
mu_errstring (status));
return;
}
......
......@@ -54,6 +54,7 @@
#include <mailutils/stream.h>
#include <mailutils/mutil.h>
#include <mailutils/error.h>
#include <mailutils/errno.h>
#include <argcv.h>
#include <mu_argp.h>
......
......@@ -7,7 +7,7 @@ LDLIBS = -lsocket
# On GNU/Linux (if compile with threads)
#LDLIBS = -lpthread
MULIBS = ../mailbox/.libs/libmailbox.a ../lib/libmailutils.a
MULIBS = ../mailbox/.libs/libmailbox.a ../lib/.libs/libmailutils.a
EXES = addr mbox-explode mbox-dates mbox-auth url-parse mbox-check mimetest msg-send
......
......@@ -4,35 +4,6 @@
#define EPARSE ENOENT
static const char *
err_name (int e)
{
struct
{
int e;
const char *s;
}
map[] =
{
#define E(e) { e, #e },
E (EPARSE) E (EINVAL) E (ENOMEM)
#undef E
{
0, NULL}
};
static char s[sizeof (int) * 8 + 3];
int i;
for (i = 0; map[i].s; i++)
{
if (map[i].e == e)
return map[i].s;
}
sprintf (s, "[%d]", e);
return s;
}
static int
parse (const char *str)
{
......@@ -50,7 +21,7 @@ parse (const char *str)
if (status)
{
printf ("%s=> error %s\n\n", str, err_name (status));
printf ("%s=> error %s\n\n", str, mu_errname (status));
return 0;
}
else
......
......@@ -10,10 +10,11 @@
#include <time.h>
#include <unistd.h>
#include <mailutils/mailbox.h>
#include <mailutils/address.h>
#include <mailutils/registrar.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/parse822.h>
#include <mailutils/registrar.h>
int
main (int argc, char **argv)
......@@ -35,7 +36,7 @@ main (int argc, char **argv)
if ((status = mailbox_create_default (&mbox, mboxname)) != 0)
{
fprintf (stderr, "could not create <%s>: %s\n",
mboxname, strerror (status));
mboxname, mu_errstring (status));
return status;
}
......@@ -48,7 +49,7 @@ main (int argc, char **argv)
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
fprintf (stderr, "could not open <%s>: %s\n",
mboxname, strerror (status));
mboxname, mu_errstring (status));
mailbox_destroy (&mbox);
exit (1);
}
......@@ -56,7 +57,7 @@ main (int argc, char **argv)
if ((status = mailbox_messages_count (mbox, &count)) != 0)
{
fprintf (stderr, "could not count <%s>: %s\n",
mboxname, strerror (status));
mboxname, mu_errstring (status));
mailbox_close (mbox);
mailbox_destroy (&mbox);
exit (1);
......
......@@ -10,10 +10,11 @@
#include <time.h>
#include <unistd.h>
#include <mailutils/mailbox.h>
#include <mailutils/address.h>
#include <mailutils/registrar.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/parse822.h>
#include <mailutils/registrar.h>
static const char *
......@@ -73,7 +74,7 @@ main (int argc, char **argv)
if ((status = mailbox_create_default (&mbox, mboxname)) != 0)
{
fprintf (stderr, "could not create <%s>: %s\n",
mboxname, strerror (status));
mboxname, mu_errstring (status));
exit (1);
}
......@@ -86,7 +87,7 @@ main (int argc, char **argv)
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
fprintf (stderr, "could not open mbox: %s\n", strerror (status));
fprintf (stderr, "could not open mbox: %s\n", mu_errstring (status));
exit (1);
}
......@@ -102,7 +103,7 @@ main (int argc, char **argv)
if ((status = mailbox_get_message (mbox, i, &msg)) != 0 ||
(status = message_get_header (msg, &hdr)) != 0)
{
printf ("%s, msg %d: %s\n", mboxname, i, strerror (status));
printf ("%s, msg %d: %s\n", mboxname, i, mu_errstring (status));
continue;
}
if ((status =
......
......@@ -11,6 +11,7 @@
#include <time.h>
#include <unistd.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/registrar.h>
......@@ -51,7 +52,7 @@ main (int argc, char **argv)
if ((status = mailbox_create_default (&mbox, mbox_name)) != 0)
{
fprintf (stderr, "could not create <%s>: %s\n",
mbox_name, strerror (status));
mbox_name, mu_errstring (status));
exit (1);
}
if(debug)
......@@ -64,7 +65,7 @@ main (int argc, char **argv)
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
fprintf (stderr, "could not open <%s>: %s\n",
mbox_name, strerror (status));
mbox_name, mu_errstring (status));
exit (1);
}
mailbox_messages_count (mbox, &count);
......@@ -85,14 +86,14 @@ main (int argc, char **argv)
if ((status = mailbox_get_message (mbox, msgno, &msg)) != 0)
{
fprintf (stderr, "msg %d: get message failed: %s\n",
msgno, strerror (status));
msgno, mu_errstring (status));
mailbox_close (mbox);
exit (1);
}
if ((status = message_get_num_parts (msg, &nparts)))
{
fprintf (stderr, "msg %d: get num parts failed: %s\n",
msgno, strerror (status));
msgno, mu_errstring (status));
mailbox_close (mbox);
exit (1);
}
......@@ -110,14 +111,14 @@ main (int argc, char **argv)
if ((status = message_get_part (msg, partno, &part)))
{
fprintf (stderr, "msg %d: get part %d failed: %s\n",
msgno, partno, strerror (status));
msgno, partno, mu_errstring (status));
mailbox_close (mbox);
exit (1);
}
if ((status = message_save_attachment (part, path, 0)))
{
fprintf (stderr, "msg %d part %d: save failed: %s\n",
msgno, partno, strerror (status));
msgno, partno, mu_errstring (status));
break;
}
}
......
......@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/header.h>
#include <mailutils/filter.h>
......@@ -67,7 +68,7 @@ main (int argc, char **argv)
if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0)
{
fprintf (stderr, "could not create - %s\n", strerror (ret));
fprintf (stderr, "could not create - %s\n", mu_errstring (ret));
exit (2);
}
......@@ -82,7 +83,7 @@ main (int argc, char **argv)
/* Open the mailbox for reading only. */
if ((ret = mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
{
fprintf (stderr, "mailbox open - %s\n", strerror (ret));
fprintf (stderr, "mailbox open - %s\n", mu_errstring (ret));
exit (2);
}
......@@ -98,17 +99,17 @@ main (int argc, char **argv)
if ((ret = mailbox_get_message (mbox, i, &msg)) != 0)
{
fprintf (stderr, "mailbox_get_message - %s\n", strerror (ret));
fprintf (stderr, "mailbox_get_message - %s\n", mu_errstring (ret));
exit (2);
}
if ((ret = message_size (msg, &msize)) != 0)
{
fprintf (stderr, "message_size - %s\n", strerror (ret));
fprintf (stderr, "message_size - %s\n", mu_errstring (ret));
exit (2);
}
if ((ret = message_get_header (msg, &hdr)) != 0)
{
fprintf (stderr, "message_get_header - %s\n", strerror (ret));
fprintf (stderr, "message_get_header - %s\n", mu_errstring (ret));
exit (2);
}
header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
......@@ -120,7 +121,7 @@ main (int argc, char **argv)
if ((ret = message_get_num_parts (msg, &nparts)) != 0)
{
fprintf (stderr, "message_get_num_parts - %s\n", strerror (ret));
fprintf (stderr, "message_get_num_parts - %s\n", mu_errstring (ret));
exit (2);
}
printf ("-- Number of parts in message - %d\n", nparts);
......@@ -151,7 +152,7 @@ message_display_parts (message_t msg, const char *indent)
/* How many parts does the message has? */
if ((ret = message_get_num_parts (msg, &nparts)) != 0)
{
fprintf (stderr, "message_get_num_parts - %s\n", strerror (ret));
fprintf (stderr, "message_get_num_parts - %s\n", mu_errstring (ret));
exit (2);
}
......@@ -162,17 +163,17 @@ message_display_parts (message_t msg, const char *indent)
{
if ((ret = message_get_part (msg, j, &part)) != 0)
{
fprintf (stderr, "mime_get_part - %s\n", strerror (ret));
fprintf (stderr, "mime_get_part - %s\n", mu_errstring (ret));
exit (2);
}
if ((ret = message_size (part, &msize)) != 0)
{
fprintf (stderr, "message_size - %s\n", strerror (ret));
fprintf (stderr, "message_size - %s\n", mu_errstring (ret));
exit (2);
}
if ((ret = message_get_header (part, &hdr)) != 0)
{
fprintf (stderr, "message_get_header - %s\n", strerror (ret));
fprintf (stderr, "message_get_header - %s\n", mu_errstring (ret));
exit (2);
}
header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type),
......@@ -194,12 +195,12 @@ message_display_parts (message_t msg, const char *indent)
ret = message_unencapsulate (part, &part, NULL);
if (ret != 0)
fprintf (stderr, "message_unencapsulate - %s\n",
strerror (ret));
mu_errstring (ret));
break;
}
if ((ret = message_get_header (part, &hdr)) != 0)
{
fprintf (stderr, "message_get_header - %s\n", strerror (ret));
fprintf (stderr, "message_get_header - %s\n", mu_errstring (ret));
exit (2);
}
header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
......@@ -211,7 +212,7 @@ message_display_parts (message_t msg, const char *indent)
indent);
if ((ret = message_get_num_parts (part, &nsubparts)) != 0)
{
fprintf (stderr, "mime_get_num_parts - %s\n", strerror (ret));
fprintf (stderr, "mime_get_num_parts - %s\n", mu_errstring (ret));
exit (2);
}
strcpy (tmp, indent);
......
......@@ -8,13 +8,14 @@
#include <unistd.h>
#include <mailutils/address.h>
#include <mailutils/errno.h>
#include <mailutils/mailer.h>
#include <mailutils/message.h>
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#define C(X) {int e; if((e = X) != 0) { \
fprintf(stderr, "%s failed: %s\n", #X, strerror(e)); \
fprintf(stderr, "%s failed: %s\n", #X, mu_errstring(e)); \
exit(1); } }
const char USAGE[] =
......
#include <mailutils/errno.h>
#include <mailutils/url.h>
#include <stdio.h>
#include <string.h>
......@@ -21,13 +22,13 @@ main ()
if ((rc = url_create(&u, str)) != 0)
{
fprintf(stderr, "url_create %s ERROR: [%d] %s",
str, rc, strerror(rc));
str, rc, mu_errstring(rc));
exit (1);
}
if ((rc = url_parse (u)) != 0)
{
printf ("%s --> FAILED: [%d] %s\n",
str, rc, strerror(rc));
str, rc, mu_errstring(rc));
continue;
}
printf ("%s --> SUCCESS\n", str);
......
......@@ -33,8 +33,9 @@
#include <string.h>
#include <unistd.h>
#include <mailutils/mailbox.h>
#include <mailutils/address.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/registrar.h>
int
......@@ -66,7 +67,7 @@ main(int argc, char **argv)
if ((status = mailbox_create_default (&mbox, mailbox_name)) != 0)
{
fprintf (stderr, "could not create/open: %s\n", strerror (status));
fprintf (stderr, "could not create/open: %s\n", mu_errstring (status));
exit (1);
}
......@@ -79,7 +80,7 @@ main(int argc, char **argv)
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
fprintf (stderr, "could not create/open: %s\n", strerror (status));
fprintf (stderr, "could not create/open: %s\n", mu_errstring (status));
exit (1);
}
......@@ -92,7 +93,7 @@ main(int argc, char **argv)
if ((status = mailbox_get_message (mbox, i, &msg)) != 0
|| (status = message_get_header (msg, &hdr)) != 0)
{
fprintf (stderr, "msg %d : %s\n", i, strerror(status));
fprintf (stderr, "msg %d : %s\n", i, mu_errstring(status));
exit(2);
}
......
......@@ -39,7 +39,7 @@ collect_open_default ()
|| mailbox_open (mbox, MU_STREAM_RDWR) != 0)
{
util_error ("can't open default mailbox %s: %s",
default_mailbox, strerror (errno));
default_mailbox, mu_errstring (errno));
exit (1);
}
......
......@@ -26,6 +26,7 @@
#include <errno.h>
#include <string.h> /* strerror(3), strdup(3) */
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/header.h>
......
......@@ -71,6 +71,7 @@
#include <mailutils/address.h>
#include <mailutils/body.h>
#include <mailutils/errno.h>
#include <mailutils/error.h>
#include <mailutils/filter.h>
#include <mailutils/folder.h>
......
......@@ -341,17 +341,17 @@ main (int argc, char **argv)
/* open the mailbox */
if (args.file == NULL)
{
if (mailbox_create_default (&mbox, args.user) != 0)
if ((rc = mailbox_create_default (&mbox, args.user)) != 0)
{
util_error ("Can not create mailbox for %s: %s", args.user,
strerror (errno));
mu_errstring (rc));
exit (EXIT_FAILURE);
}
}
else if (mailbox_create_default (&mbox, args.file) != 0)
else if ((rc = mailbox_create_default (&mbox, args.file)) != 0)
{
util_error ("Can not create mailbox %s: %s", args.file,
strerror (errno));
mu_errstring (errno));
exit (EXIT_FAILURE);
}
......@@ -368,7 +368,7 @@ main (int argc, char **argv)
url_t url = NULL;
mailbox_get_url (mbox, &url);
util_error ("Can not open mailbox %s: %s",
url_to_string (url), strerror (rc));
url_to_string (url), mu_errstring (rc));
exit (EXIT_FAILURE);
}
......
......@@ -52,6 +52,7 @@
#include <readline/history.h>
#endif
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/header.h>
......
......@@ -33,7 +33,9 @@
#include "md5-rsa.h"
#include <message0.h>
#include <mailutils/address.h>
#include <mailutils/errno.h>
#include <mailutils/mutil.h>
#define MESSAGE_MODIFIED 0x10000;
......@@ -1017,7 +1019,7 @@ message_save_to_mailbox (message_t msg, ticket_t ticket, mu_debug_t debug,
{
mu_debug_print (debug, MU_DEBUG_TRACE,
"mailbox_create_default (%s) failed: %s\n", toname,
strerror (rc));
mu_errstring (rc));
goto end;
}
......@@ -1048,7 +1050,7 @@ message_save_to_mailbox (message_t msg, ticket_t ticket, mu_debug_t debug,
{
mu_debug_print (debug, MU_DEBUG_TRACE,
"mailbox_open (%s) failed: %s\n", toname,
strerror (rc));
mu_errstring (rc));
goto end;
}
......@@ -1056,7 +1058,7 @@ message_save_to_mailbox (message_t msg, ticket_t ticket, mu_debug_t debug,
{
mu_debug_print (debug, MU_DEBUG_TRACE,
"mailbox_append_message (%s) failed: %s\n", toname,
strerror (rc));
mu_errstring (rc));
goto end;
}
......@@ -1068,7 +1070,7 @@ end:
{
mu_debug_print (debug, MU_DEBUG_TRACE,
"mailbox_close (%s) failed: %s\n", toname,
strerror (rc));
mu_errstring (rc));
}
}
else
......
......@@ -28,7 +28,9 @@
#include <unistd.h>
#include <ctype.h>
#include <mailutils/errno.h>
#include <mailutils/mutil.h>
#include <auth0.h>
#include <url0.h>
......@@ -324,7 +326,7 @@ get_ticket (url_t url, const char *user, const char *filename, url_t * ticket)
{
/* TODO: send output to the debug stream */
/*
printf ("url_parse %s failed: [%d] %s\n", str, err, strerror (err));
printf ("url_parse %s failed: [%d] %s\n", str, err, mu_errstring (err));
*/
url_destroy (&u);
continue;
......
......@@ -61,7 +61,7 @@ pop3d_apopuser (const char *user)
syslog (LOG_INFO, "Bad permissions on APOP password db");
else
syslog (LOG_ERR, "Unable to open APOP db: %s",
strerror (rc));
mu_errstring (rc));
return NULL;
}
......@@ -78,7 +78,7 @@ pop3d_apopuser (const char *user)
mu_dbm_close (db);
if (rc)
{
syslog (LOG_ERR, "Can't fetch APOP data: %s", strerror (rc));
syslog (LOG_ERR, "Can't fetch APOP data: %s", mu_errstring (rc));
return NULL;
}
password = calloc (MU_DATUM_SIZE(data) + 1, sizeof (*password));
......
......@@ -109,6 +109,7 @@
# include <strings.h>
#endif
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailutils/header.h>
......
......@@ -248,7 +248,7 @@ main (int argc, char **argv)
status = mailbox_create_default (&mbox, mailbox_name);
if (status != 0)
{
fprintf (stderr, "could not create - %s\n", strerror(status));
fprintf (stderr, "could not create - %s\n", mu_errstring(status));
exit (2);
}
......@@ -263,7 +263,7 @@ main (int argc, char **argv)
status = mailbox_open (mbox, MU_STREAM_READ);
if (status != 0)
{
fprintf (stderr, "mailbox open - %s\n", strerror(status));
fprintf (stderr, "mailbox open - %s\n", mu_errstring(status));
exit (2);
}
......@@ -282,7 +282,7 @@ main (int argc, char **argv)
status = mailbox_get_message (mbox, set[i], &msg);
if (status != 0)
{
fprintf (stderr, "mailbox_get_message - %s\n", strerror (status));
fprintf (stderr, "mailbox_get_message - %s\n", mu_errstring (status));
exit (2);
}
......
......@@ -28,6 +28,7 @@
#include <errno.h>
#include <getopt.h>
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/header.h>
#include <mailutils/mime.h>
......
......@@ -24,6 +24,7 @@ sieve script interpreter.
#include "sieve.h"
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/mutil.h>
#include <mailutils/registrar.h>
......@@ -188,10 +189,10 @@ execute_error (const char *script, message_t msg, int rc, const char *errmsg)
message_get_uid (msg, &uid);
if (rc)
fprintf (stderr, "%s on msg uid %d failed: %s\n", script, uid, errmsg);
else
fprintf (stderr, "%s on msg uid %d failed: %s (%s)\n", script, uid,
errmsg, strerror (rc));
errmsg, mu_errstring (rc));
else
fprintf (stderr, "%s on msg uid %d failed: %s\n", script, uid, errmsg);
}
static void
......@@ -343,12 +344,12 @@ main (int argc, char *argv[])
if ((rc = wicket_create (&wicket, opts.tickets)) != 0)
{
fprintf (stderr, "wicket create <%s> failed: %s\n",
opts.tickets, strerror (rc));
opts.tickets, mu_errstring (rc));
goto cleanup;
}
if ((rc = wicket_get_ticket (wicket, &ticket, 0, 0)) != 0)
{
fprintf (stderr, "ticket get failed: %s\n", strerror (rc));
fprintf (stderr, "ticket get failed: %s\n", mu_errstring (rc));
goto cleanup;
}
}
......@@ -358,17 +359,17 @@ main (int argc, char *argv[])
{
if ((rc = mu_debug_create (&debug, interp)))
{
fprintf (stderr, "mu_debug_create failed: %s\n", strerror (rc));
fprintf (stderr, "mu_debug_create failed: %s\n", mu_errstring (rc));
goto cleanup;
}
if ((rc = mu_debug_set_level (debug, opts.debug_level)))
{
fprintf (stderr, "mu_debug_set_level failed: %s\n", strerror (rc));
fprintf (stderr, "mu_debug_set_level failed: %s\n", mu_errstring (rc));
goto cleanup;
}
if ((rc = mu_debug_set_print (debug, debug_print, interp)))
{
fprintf (stderr, "mu_debug_set_print failed: %s\n", strerror (rc));
fprintf (stderr, "mu_debug_set_print failed: %s\n", mu_errstring (rc));
goto cleanup;
}
}
......@@ -377,12 +378,12 @@ main (int argc, char *argv[])
if ((rc = mailer_create(&mailer, opts.mailer)))
{
fprintf (stderr, "mailer create <%s> failed: %s\n",
opts.mailer, strerror (rc));
opts.mailer, mu_errstring (rc));
goto cleanup;
}
if (debug && (rc = mailer_set_debug (mailer, debug)))
{
fprintf (stderr, "mailer_set_debug failed: %s\n", strerror (rc));
fprintf (stderr, "mailer_set_debug failed: %s\n", mu_errstring (rc));
goto cleanup;
}
......@@ -390,13 +391,13 @@ main (int argc, char *argv[])
if ((rc = mailbox_create_default (&mbox, opts.mbox)) != 0)
{
fprintf (stderr, "mailbox create <%s> failed: %s\n",
opts.mbox ? opts.mbox : "default", strerror (rc));
opts.mbox ? opts.mbox : "default", mu_errstring (rc));
goto cleanup;
}
if (debug && (rc = mailbox_set_debug (mbox, debug)))
{
fprintf (stderr, "mailbox_set_debug failed: %s\n", strerror (rc));
fprintf (stderr, "mailbox_set_debug failed: %s\n", mu_errstring (rc));
goto cleanup;
}
......@@ -407,20 +408,20 @@ main (int argc, char *argv[])
if ((rc = mailbox_get_folder (mbox, &folder)))
{
fprintf (stderr, "mailbox_get_folder failed: %s", strerror (rc));
fprintf (stderr, "mailbox_get_folder failed: %s", mu_errstring (rc));
goto cleanup;
}
if ((rc = folder_get_authority (folder, &auth)))
{
fprintf (stderr, "folder_get_authority failed: %s", strerror (rc));
fprintf (stderr, "folder_get_authority failed: %s", mu_errstring (rc));
goto cleanup;
}
/* Authentication-less folders don't have authorities. */
if (auth && (rc = authority_set_ticket (auth, ticket)))
{
fprintf (stderr, "authority_set_ticket failed: %s", strerror (rc));
fprintf (stderr, "authority_set_ticket failed: %s", mu_errstring (rc));
goto cleanup;
}
}
......@@ -434,7 +435,7 @@ main (int argc, char *argv[])
if (rc != 0)
{
fprintf (stderr, "open on %s failed: %s\n",
opts.mbox ? opts.mbox : "default", strerror (rc));
opts.mbox ? opts.mbox : "default", mu_errstring (rc));
goto cleanup;
}
......@@ -444,7 +445,7 @@ main (int argc, char *argv[])
if (rc != 0)
{
fprintf (stderr, "message count on %s failed: %s\n",
opts.mbox ? opts.mbox : "default", strerror (rc));
opts.mbox ? opts.mbox : "default", mu_errstring (rc));
goto cleanup;
}
......@@ -455,7 +456,7 @@ main (int argc, char *argv[])
if ((rc = mailbox_get_message (mbox, msgno, &msg)) != 0)
{
fprintf (stderr, "get message on %s (msg %d) failed: %s\n",
opts.mbox ? opts.mbox : "default", msgno, strerror (rc));
opts.mbox ? opts.mbox : "default", msgno, mu_errstring (rc));
goto cleanup;
}
......@@ -484,7 +485,7 @@ cleanup:
on a later message. */
if ((e = mailbox_expunge (mbox)) != 0)
fprintf (stderr, "expunge on %s failed: %s\n",
opts.mbox ? opts.mbox : "default", strerror (e));
opts.mbox ? opts.mbox : "default", mu_errstring (e));
if(e && !rc)
rc = e;
......
#ifndef SV_H
#define SV_H
#include <mailutils/errno.h>
#include <mailutils/mailbox.h>
#include <mailutils/address.h>
#include <mailutils/registrar.h>
......
......@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include <mailutils/errno.h>
#include <mailutils/envelope.h>
#include "sv.h"
......@@ -247,7 +248,7 @@ sv_redirect (void *ac, void *ic, void *sc, void *mc, const char **errmsg)
{
mu_debug_print (m->debug, MU_DEBUG_ERROR,
"redirect - parsing to '%s' failed: [%d] %s\n",
a->addr, m->rc, strerror (m->rc));
a->addr, m->rc, mu_errstring (m->rc));
goto end;
}
......@@ -273,7 +274,7 @@ sv_redirect (void *ac, void *ic, void *sc, void *mc, const char **errmsg)
{
mu_debug_print (m->debug, MU_DEBUG_ERROR,
"redirect - parsing from '%s' failed: [%d] %s\n",
a->addr, m->rc, strerror (m->rc));
a->addr, m->rc, mu_errstring (m->rc));
goto end;
}
......@@ -281,7 +282,7 @@ sv_redirect (void *ac, void *ic, void *sc, void *mc, const char **errmsg)
{
mu_debug_print (m->debug, MU_DEBUG_ERROR,
"redirect - opening mailer '%s' failed: [%d] %s\n",
m->mailer, m->rc, strerror (m->rc));
m->mailer, m->rc, mu_errstring (m->rc));
goto end;
}
......@@ -289,7 +290,7 @@ sv_redirect (void *ac, void *ic, void *sc, void *mc, const char **errmsg)
{
mu_debug_print (m->debug, MU_DEBUG_ERROR,
"redirect - send from '%s' to '%s' failed: [%d] %s\n",
fromaddr, a->addr, m->rc, strerror (m->rc));
fromaddr, a->addr, m->rc, mu_errstring (m->rc));
goto end;
}
......@@ -319,7 +320,7 @@ sv_discard (void *ac, void *ic, void *sc, void *mc, const char **errmsg)
m->rc = sv_mu_mark_deleted (m->msg, 1);
mu_debug_print (m->debug, MU_DEBUG_ERROR,
"discard - deleting failed: [%d] %s\n",
m->rc, strerror (m->rc));
m->rc, mu_errstring (m->rc));
}
return sieve_err (m->rc);
......
......@@ -14,7 +14,7 @@ sv_strerror (int e)
case SV_EPARSE:
return "parse failure";
}
return strerror (e);
return mu_errstring (e);
}
int
......