From 755f55b0dbb0ffadc0acf020123c727dcf558354 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 19 Dec 1995 10:00:22 +0000 Subject: Mon Dec 18 13:40:37 1995 Roland McGrath * stdio/fread.c: Don't increment __offset when it's -1. * elf/rtld.c (dl_main): Prepend tab to "statically linked". Exit 0 in that case. * misc/err.c (vwarnx, vwarn): Fix major brainos. * sysdeps/mach/hurd/dl-sysdep.c (mmap): Fix setting of inheritance. --- misc/err.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'misc/err.c') diff --git a/misc/err.c b/misc/err.c index 82719a8..3ad7bf3 100644 --- a/misc/err.c +++ b/misc/err.c @@ -20,6 +20,8 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include +#include #include extern char *__progname; @@ -33,18 +35,28 @@ extern char *__progname; } void -vwarn (const char *format, __gnuc_va_list ap) +vwarnx (const char *format, __gnuc_va_list ap) { - fprintf (stderr, format, ap); + if (__progname) + fprintf (stderr, "%s: ", __progname); + if (format) + vfprintf (stderr, format, ap); + putc ('\n', stderr); } void -vwarnx (const char *format, __gnuc_va_list ap) +vwarn (const char *format, __gnuc_va_list ap) { + int error = errno; + if (__progname) fprintf (stderr, "%s: ", __progname); - fprintf (stderr, format, ap); - putc ('\n', stderr); + if (format) + { + vfprintf (stderr, format, ap); + fputs (": ", stderr); + } + fprintf (stderr, "%s\n", strerror (error)); } -- cgit v1.1