mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Mon Dec 18 13:40:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* 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.
This commit is contained in:
26
misc/err.c
26
misc/err.c
@@ -20,6 +20,8 @@ Cambridge, MA 02139, USA. */
|
||||
#include <stdarg.h>
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern char *__progname;
|
||||
@@ -32,21 +34,31 @@ extern char *__progname;
|
||||
va_end (ap); \
|
||||
}
|
||||
|
||||
void
|
||||
vwarn (const char *format, __gnuc_va_list ap)
|
||||
{
|
||||
fprintf (stderr, format, ap);
|
||||
}
|
||||
|
||||
void
|
||||
vwarnx (const char *format, __gnuc_va_list ap)
|
||||
{
|
||||
if (__progname)
|
||||
fprintf (stderr, "%s: ", __progname);
|
||||
fprintf (stderr, format, ap);
|
||||
if (format)
|
||||
vfprintf (stderr, format, ap);
|
||||
putc ('\n', stderr);
|
||||
}
|
||||
|
||||
void
|
||||
vwarn (const char *format, __gnuc_va_list ap)
|
||||
{
|
||||
int error = errno;
|
||||
|
||||
if (__progname)
|
||||
fprintf (stderr, "%s: ", __progname);
|
||||
if (format)
|
||||
{
|
||||
vfprintf (stderr, format, ap);
|
||||
fputs (": ", stderr);
|
||||
}
|
||||
fprintf (stderr, "%s\n", strerror (error));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
warn (const char *format, ...)
|
||||
|
Reference in New Issue
Block a user