summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-07-26 12:36:29 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-07-26 12:36:29 +0000
commit31f9e897d6c4a2faa83e96c437493554c12e48d3 (patch)
tree7af89f0da14d144ae7da17acbbb7a584b637c550
parent6dbe7cac71bbec6a56c6498267359e3699bdc539 (diff)
downloadmailutils-31f9e897d6c4a2faa83e96c437493554c12e48d3.tar.gz
mailutils-31f9e897d6c4a2faa83e96c437493554c12e48d3.tar.bz2
Produce more detailed diagnostics
-rw-r--r--examples/mimetest.c3
-rw-r--r--mail/copy.c14
-rw-r--r--mail/quit.c16
-rw-r--r--mail/send.c3
4 files changed, 26 insertions, 10 deletions
diff --git a/examples/mimetest.c b/examples/mimetest.c
index dab6edb2d..d91b15ccd 100644
--- a/examples/mimetest.c
+++ b/examples/mimetest.c
@@ -88,7 +88,8 @@ main (int argc, char **argv)
if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0)
{
- fprintf (stderr, "could not create - %s\n", mu_strerror (ret));
+ fprintf (stderr, "could not create %s: %s\n",
+ mailbox_name, mu_strerror (ret));
exit (2);
}
diff --git a/mail/copy.c b/mail/copy.c
index 3267b0674..0300f6e5b 100644
--- a/mail/copy.c
+++ b/mail/copy.c
@@ -63,10 +63,18 @@ mail_copy0 (int argc, char **argv, int mark)
return 1;
}
- if (mailbox_create_default (&mbx, filename)
- || mailbox_open (mbx, MU_STREAM_WRITE | MU_STREAM_CREAT))
+ if ((status = mailbox_create_default (&mbx, filename)) != 0)
{
- util_error (_("Cannot create mailbox %s"), filename);
+ util_error (_("Cannot create mailbox %s: %s"), filename,
+ mu_strerror (status));
+ free (filename);
+ msgset_free (msglist);
+ return 1;
+ }
+ if ((status = mailbox_open (mbx, MU_STREAM_WRITE | MU_STREAM_CREAT)) != 0)
+ {
+ util_error (_("Cannot open mailbox %s: %s"), filename,
+ mu_strerror (status));
free (filename);
msgset_free (msglist);
return 1;
diff --git a/mail/quit.c b/mail/quit.c
index 533892926..26a61c2e3 100644
--- a/mail/quit.c
+++ b/mail/quit.c
@@ -105,12 +105,18 @@ mail_mbox_commit ()
if (!dest_mbox)
{
char *name = getenv ("MBOX");
-
- if (mailbox_create_default (&dest_mbox, name)
- || mailbox_open (dest_mbox,
- MU_STREAM_WRITE | MU_STREAM_CREAT))
+
+ if ((status = mailbox_create_default (&dest_mbox, name)) != 0)
+ {
+ util_error (_("Cannot create mailbox %s: %s"), name,
+ mu_strerror (status));
+ return 1;
+ }
+ if ((status = mailbox_open (dest_mbox,
+ MU_STREAM_WRITE | MU_STREAM_CREAT))!=0)
{
- util_error (_("Cannot create mailbox %s"), name);
+ util_error (_("Cannot open mailbox %s: %s"), name,
+ mu_strerror (status));
return 1;
}
}
diff --git a/mail/send.c b/mail/send.c
index 37a0607dd..3e3240b2d 100644
--- a/mail/send.c
+++ b/mail/send.c
@@ -539,7 +539,8 @@ mail_send0 (compose_env_t * env, int save_to)
mailbox_destroy (&mbx);
}
if (status)
- util_error (_("Cannot create mailbox %s"), env->outfiles[i]);
+ util_error (_("Cannot create mailbox %s: %s"),
+ env->outfiles[i], mu_strerror (status));
}
}
}

Return to:

Send suggestions and report system problems to the System administrator.