diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-05-18 10:20:42 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-05-18 10:20:42 -0400 |
commit | 69ee9b2cb169ee843ac9e209f919d088499152f7 (patch) | |
tree | 99ed9ef7fb0b925084db87dc9f740fa6c866c28a /src/legacy | |
parent | 22730d65608db06500cc6e0be4aaec03238f996b (diff) | |
download | musl-69ee9b2cb169ee843ac9e209f919d088499152f7.tar.gz musl-69ee9b2cb169ee843ac9e209f919d088499152f7.tar.bz2 musl-69ee9b2cb169ee843ac9e209f919d088499152f7.tar.xz musl-69ee9b2cb169ee843ac9e209f919d088499152f7.zip |
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.
Diffstat (limited to 'src/legacy')
-rw-r--r-- | src/legacy/err.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 <stdarg.h> #include <stdlib.h> +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); } |