From: Rich Felker Date: Sat, 18 May 2013 14:20:42 +0000 (-0400) Subject: make err.h functions print __progname X-Git-Tag: v0.9.11~53 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=69ee9b2cb169ee843ac9e209f919d088499152f7;p=oweals%2Fmusl.git 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. --- 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); }