diff options
Diffstat (limited to 'lib/libc/gen/err.c')
-rw-r--r-- | lib/libc/gen/err.c | 135 |
1 files changed, 3 insertions, 132 deletions
diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index bc825899183..094ea952a98 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -1,4 +1,5 @@ -/* $NetBSD: err.c,v 1.12 1995/02/25 17:19:26 cgd Exp $ */ +/* $OpenBSD: err.c,v 1.2 1996/04/21 23:39:17 deraadt Exp $ */ +/* $NetBSD: err.c,v 1.13 1996/04/15 23:45:29 jtc Exp $ */ /*- * Copyright (c) 1993 @@ -37,15 +38,11 @@ #if 0 static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$NetBSD: err.c,v 1.12 1995/02/25 17:19:26 cgd Exp $"; +static char rcsid[] = "$NetBSD: err.c,v 1.13 1996/04/15 23:45:29 jtc Exp $"; #endif #endif /* LIBC_SCCS and not lint */ #include <err.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #ifdef __STDC__ #include <stdarg.h> @@ -53,26 +50,6 @@ static char rcsid[] = "$NetBSD: err.c,v 1.12 1995/02/25 17:19:26 cgd Exp $"; #include <varargs.h> #endif -extern char *__progname; /* Program name, from crt0. */ - -__dead void -_verr(eval, fmt, ap) - int eval; - const char *fmt; - va_list ap; -{ - int sverrno; - - sverrno = errno; - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) { - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, ": "); - } - (void)fprintf(stderr, "%s\n", strerror(sverrno)); - exit(eval); -} - __dead void #ifdef __STDC__ _err(int eval, const char *fmt, ...) @@ -95,109 +72,3 @@ _err(va_alist) _verr(eval, fmt, ap); va_end(ap); } - -__dead void -_verrx(eval, fmt, ap) - int eval; - const char *fmt; - va_list ap; -{ - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, "\n"); - exit(eval); -} - -__dead void -#if __STDC__ -_errx(int eval, const char *fmt, ...) -#else -_errx(va_alist) - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - int eval; - const char *fmt; - - va_start(ap); - eval = va_arg(ap, int); - fmt = va_arg(ap, const char *); -#endif - _verrx(eval, fmt, ap); - va_end(ap); -} - - -void -_vwarn(fmt, ap) - const char *fmt; - va_list ap; -{ - int sverrno; - - sverrno = errno; - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) { - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, ": "); - } - (void)fprintf(stderr, "%s\n", strerror(sverrno)); -} - -void -#if __STDC__ -_warn(const char *fmt, ...) -#else -_warn(va_alist) - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif - _vwarn(fmt, ap); - va_end(ap); -} - -void -_vwarnx(fmt, ap) - const char *fmt; - va_list ap; -{ - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, "\n"); -} - -void -#ifdef __STDC__ -_warnx(const char *fmt, ...) -#else -_warnx(va_alist) - va_dcl -#endif -{ - va_list ap; -#ifdef __STDC__ - va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif - _vwarnx(fmt, ap); - va_end(ap); -} |