Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mailwrapper Correct args to err(), no need to inclu...



details:   https://anonhg.NetBSD.org/src/rev/4896d538de6f
branches:  trunk
changeset: 544023:4896d538de6f
user:      mjl <mjl%NetBSD.org@localhost>
date:      Sat Mar 08 22:57:51 2003 +0000

description:
Correct args to err(), no need to include "mailwrapper:" prefix manually.
Triggered by posting to OpenBSD mailing list.

diffstat:

 usr.sbin/mailwrapper/mailwrapper.c |  19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diffs (63 lines):

diff -r c85bfe07a0ee -r 4896d538de6f usr.sbin/mailwrapper/mailwrapper.c
--- a/usr.sbin/mailwrapper/mailwrapper.c        Sat Mar 08 22:14:31 2003 +0000
+++ b/usr.sbin/mailwrapper/mailwrapper.c        Sat Mar 08 22:57:51 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mailwrapper.c,v 1.7 2003/02/17 21:18:46 is Exp $       */
+/*     $NetBSD: mailwrapper.c,v 1.8 2003/03/08 22:57:51 mjl Exp $      */
 
 /*
  * Copyright (c) 1998
@@ -56,7 +56,7 @@
        al->argc = 0;
        al->maxc = 10;
        if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
-               err(1, "mailwrapper");
+               err(1, "malloc");
 }
 
 static void
@@ -69,11 +69,11 @@
            al->maxc <<= 1;
            if ((al->argv = realloc(al->argv,
                al->maxc * sizeof(char *))) == NULL)
-                   err(1, "mailwrapper");
+                   err(1, "realloc");
        }
        if (copy) {
                if ((al->argv[al->argc++] = strdup(arg)) == NULL)
-                       err(1, "mailwrapper:");
+                       err(1, "strdup");
        } else
                al->argv[al->argc++] = (char *)arg;
 }
@@ -94,14 +94,13 @@
        addarg(&al, argv[0], 0);
 
        if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL)
-               err(1, "mailwrapper: can't open %s", _PATH_MAILERCONF);
+               err(1, "can't open %s", _PATH_MAILERCONF);
 
        for (;;) {
                if ((line = fparseln(config, &len, &lineno, NULL, 0)) == NULL) {
                        if (feof(config))
-                               errx(1, "mailwrapper: no mapping in %s",
-                                   _PATH_MAILERCONF);
-                       err(1, "mailwrapper");
+                               errx(1, "no mapping in %s", _PATH_MAILERCONF);
+                       err(1, "fparseln");
                }
 
 #define        WS      " \t\n"
@@ -140,10 +139,10 @@
 
        addarg(&al, NULL, 0);
        execve(to, al.argv, envp);
-       err(1, "mailwrapper: execing %s", to);
+       err(1, "execing %s", to);
        /*NOTREACHED*/
 parse_error:
-       errx(1, "mailwrapper: parse error in %s at line %lu",
+       errx(1, "parse error in %s at line %lu",
            _PATH_MAILERCONF, (u_long)lineno);
        /*NOTREACHED*/
 }



Home | Main Index | Thread Index | Old Index