mirror of git://git.musl-libc.org/musl
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.
This commit is contained in:
parent
22730d6560
commit
69ee9b2cb1
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue