From 69ee9b2cb169ee843ac9e209f919d088499152f7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 18 May 2013 10:20:42 -0400 Subject: [PATCH] make err.h functions print __progname patch by Strake. previously is was not feasible to duplicate this functionality of the functions these were modeled on, since argv[0] was not saved at program startup, but now that it's available it's easy to use. --- src/legacy/err.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/legacy/err.c b/src/legacy/err.c index 0f748538..7b167b36 100644 --- a/src/legacy/err.c +++ b/src/legacy/err.c @@ -3,14 +3,18 @@ #include #include +extern char *__progname; + void vwarn(const char *fmt, va_list ap) { + fprintf (stderr, "%s: ", __progname); if (fmt) vfprintf(stderr, fmt, ap); perror(""); } void vwarnx(const char *fmt, va_list ap) { + fprintf (stderr, "%s: ", __progname); if (fmt) vfprintf(stderr, fmt, ap); putc('\n', stderr); } -- 2.25.1