about summary refs log tree commit diff
path: root/stdio-common/perror.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-05 00:41:57 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-05 00:41:57 +0000
commit62ab42d67da471a5502ecbe556e7f621dae360d3 (patch)
tree2ad0df6dcb656d0906bfd3f419f24cd1d948516a /stdio-common/perror.c
parent767b6275d7bf9096e3f52348401632e1e58d4896 (diff)
downloadglibc-62ab42d67da471a5502ecbe556e7f621dae360d3.tar.gz
glibc-62ab42d67da471a5502ecbe556e7f621dae360d3.tar.xz
glibc-62ab42d67da471a5502ecbe556e7f621dae360d3.zip
Update.
2000-12-04  H.J. Lu  <hjl@gnu.org>

	* configure.in: Change --with-oldest-abi=ABI to
	--enable-oldest-abi=ABI.

2000-12-02  Bruno Haible  <haible@clisp.cons.org>

	* stdio-common/perror.c (perror): If stderr is wide-oriented, use
	fwprintf instead of fprintf.

2000-12-01  H.J. Lu  <hjl@gnu.org>

	* nss/getXXbyYY_r.c: Fix verioned symbol handling.
	* nss/getXXent_r.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.

2000-11-30  H.J. Lu  <hjl@gnu.org>

	* scripts/abi-versions.awk (oldest_abi): New variable.
	Handle the oldest ABI supported.

	* Makerules ($(common-objpfx)abi-versions.h): Set oldest_abi
	for scripts/abi-versions.awk.

	* configure.in: Add --with-oldest-abi=ABI.
	* configure: Rebuild.

	* config.make.in (oldest-abi): New.

	* config.h.in (GLIBC_OLDEST_ABI): New.

	* csu/version.c (banner): Support GLIBC_OLDEST_ABI.
Diffstat (limited to 'stdio-common/perror.c')
-rw-r--r--stdio-common/perror.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/stdio-common/perror.c b/stdio-common/perror.c
index 4c29cb09e1..239d43edc6 100644
--- a/stdio-common/perror.c
+++ b/stdio-common/perror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1997,1998,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,9 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <string.h>
-#include <errno.h>
+#include <wchar.h>
 
 /* Print a line on stderr consisting of the text in S, a colon, a space,
    a message describing the meaning of the contents of `errno' and a newline.
@@ -29,12 +30,17 @@ perror (const char *s)
   char buf[1024];
   int errnum = errno;
   const char *colon;
+  const char *errstring;
 
   if (s == NULL || *s == '\0')
     s = colon = "";
   else
     colon = ": ";
 
-  (void) fprintf (stderr, "%s%s%s\n",
-		  s, colon, __strerror_r (errnum, buf, sizeof buf));
+  errstring = __strerror_r (errnum, buf, sizeof buf);
+
+  if (fwide (stderr, 0) > 0)
+    (void) fwprintf (stderr, L"%s%s%s\n", s, colon, errstring);
+  else
+    (void) fprintf (stderr, "%s%s%s\n", s, colon, errstring);
 }