$NetBSD: patch-aa,v 1.4 2006/06/08 14:29:26 joerg Exp $ --- lib/error.c.orig 1998-04-04 22:38:04.000000000 +0000 +++ lib/error.c @@ -44,7 +44,7 @@ char *progname = NULL; jmp_buf top_level; -static FILE *errlog = stderr; +static FILE *errlog = NULL; /* **************************************************************** */ /* */ @@ -93,6 +93,8 @@ handle_error (severity, format, arg1, ar int severity; char *format, *arg1, *arg2, *arg3; { + if (errlog == NULL) + errlog = stderr; #ifdef USE_SYSLOG if (errlog == LOG_SYS) { @@ -143,13 +145,16 @@ file_error (severity, filename) int severity; char *filename; { -#ifndef linux +#if 0 extern int sys_nerr; extern char *sys_errlist[]; #endif - char *error_text; + const char *error_text; +#ifdef __INTERIX + error_text = strerror(errno); +#else if (errno) { if (errno < sys_nerr) error_text = sys_errlist[errno]; @@ -158,6 +163,7 @@ file_error (severity, filename) } else { error_text = "(Hmm, no error?)"; } +#endif if (filename == (char *)NULL) handle_error (severity, "%s", error_text, NULL, NULL);