Commit f27fbafc f27fbafce7651adb5de0f7fb62ec7dad6e66f2f8 by Sergey Poznyakoff

Use mailbox_create_default for --file=MBOX. Some calls to exit() were placed *be…

…fore* issuing diagnostics. Fixed.
1 parent a6c128be
...@@ -330,26 +330,28 @@ main (int argc, char **argv) ...@@ -330,26 +330,28 @@ main (int argc, char **argv)
330 { 330 {
331 if (mailbox_create_default (&mbox, args.user) != 0) 331 if (mailbox_create_default (&mbox, args.user) != 0)
332 { 332 {
333 util_error ("Can not create mailbox for %s: %s", args.user,
334 strerror (errno));
333 exit (EXIT_FAILURE); 335 exit (EXIT_FAILURE);
334 util_error ("Can not create mailbox for %s", args.user);
335 } 336 }
336 } 337 }
337 else if (mailbox_create (&mbox, args.file) != 0) 338 else if (mailbox_create_default (&mbox, args.file) != 0)
338 { 339 {
340 util_error ("Can not create mailbox %s: %s", args.file,
341 strerror (errno));
339 exit (EXIT_FAILURE); 342 exit (EXIT_FAILURE);
340 util_error ("Can not create mailbox %s", args.file);
341 } 343 }
342 344
343 if (mailbox_open (mbox, MU_STREAM_RDWR) != 0) 345 if (mailbox_open (mbox, MU_STREAM_RDWR) != 0)
344 { 346 {
345 exit (EXIT_FAILURE);
346 util_error ("Can not open mailbox"); 347 util_error ("Can not open mailbox");
348 exit (EXIT_FAILURE);
347 } 349 }
348 350
349 if (mailbox_messages_count (mbox, &total) != 0) 351 if (mailbox_messages_count (mbox, &total) != 0)
350 { 352 {
351 exit (EXIT_FAILURE);
352 util_error ("Can not read mailbox"); 353 util_error ("Can not read mailbox");
354 exit (EXIT_FAILURE);
353 } 355 }
354 356
355 if (strlen ("exist") == modelen && !strcmp ("exist", mode->value)) 357 if (strlen ("exist") == modelen && !strcmp ("exist", mode->value))
......