summaryrefslogtreecommitdiff
path: root/lib/error.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-12-15 15:35:15 +0000
committerJim Meyering <jim@meyering.net>1995-12-15 15:35:15 +0000
commit46faa9979fb311e24fdd968a1dcbad3892daef7f (patch)
treefc0475c49cbb6778ce357681bb22728fca75c14c /lib/error.c
parentc038102c6a7ca578c6a089fd0bd72bf00fc03ea4 (diff)
downloadcoreutils-46faa9979fb311e24fdd968a1dcbad3892daef7f.tar.xz
new version from FSF
Diffstat (limited to 'lib/error.c')
-rw-r--r--lib/error.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/error.c b/lib/error.c
index 2508ea841..a36198b6b 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -23,7 +23,7 @@
#include <stdio.h>
-#if HAVE_VPRINTF || HAVE_DOPRNT
+#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
# if __STDC__
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
@@ -36,7 +36,7 @@
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
#endif
-#if STDC_HEADERS
+#if STDC_HEADERS || _LIBC
# include <stdlib.h>
# include <string.h>
#else
@@ -51,11 +51,15 @@ unsigned int error_message_count;
function without parameters instead. */
void (*error_print_progname) () = NULL;
+#ifdef _LIBC
+#define program_name program_invocation_name
+#endif
+
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
-#if HAVE_STRERROR
+#if HAVE_STRERROR || _LIBC
# ifndef strerror /* On some systems, strerror is a macro */
char *strerror ();
# endif
@@ -105,7 +109,7 @@ error (status, errnum, message, va_alist)
#ifdef VA_START
VA_START (args, message);
-# if HAVE_VPRINTF
+# if HAVE_VPRINTF || _LIBC
vfprintf (stderr, message, args);
# else
_doprnt (message, args, stderr);