View | Details | Raw Unified | Return to bug 10412 | Differences between
and this patch

Collapse All | Expand All

(-)a/ChangeLog (+7 lines)
Lines 1-3 Link Here
1
2009-07-18  Eric Blake  <ebb9@byu.net>
2
3
	* misc/error.c (error, error_at_line) [!_LIBC]: Check that fd 1 is
4
	open before flushing stdout.  Avoids a crash on some platforms
5
	when used via gnulib to report a failed fclose (stdout) during an
6
	atexit handler.
7
1
2009-07-17  Ulrich Drepper  <drepper@redhat.com>
8
2009-07-17  Ulrich Drepper  <drepper@redhat.com>
2
	* sysdeps/generic/sysdep.h: Define cfi_personality, cfi_lsda,
9
	* sysdeps/generic/sysdep.h: Define cfi_personality, cfi_lsda,
(-)a/misc/error.c (-2 / +16 lines)
Lines 1-5 Link Here
1
/* Error handler for noninteractive utilities
1
/* Error handler for noninteractive utilities
2
   Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
2
   Copyright (C) 1990-1998, 2000-2005, 2006, 2009 Free Software
3
   Foundation, Inc.
3
   This file is part of the GNU C Library.
4
   This file is part of the GNU C Library.
4
   The GNU C Library is free software; you can redistribute it and/or
5
   The GNU C Library is free software; you can redistribute it and/or
Lines 78-83 extern void __error_at_line (int status, int errnum, const char *file_name, Link Here
78
#else /* not _LIBC */
79
#else /* not _LIBC */
80
# include <fcntl.h>
81
79
# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
82
# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
80
#  ifndef HAVE_DECL_STRERROR_R
83
#  ifndef HAVE_DECL_STRERROR_R
81
"this configure-time declaration test was not run"
84
"this configure-time declaration test was not run"
Lines 229-234 error (int status, int errnum, const char *message, ...) Link Here
229
		   0);
232
		   0);
230
#endif
233
#endif
234
#if !_LIBC
235
  /* POSIX states that fflush (stdout) after fclose is unspecified; it
236
     is safe in glibc, but not on all other platforms.  fflush (NULL)
237
     is always defined, but too draconian.  */
238
  if (0 <= fcntl (1, F_GETFL))
239
#endif
231
  fflush (stdout);
240
  fflush (stdout);
232
#ifdef _LIBC
241
#ifdef _LIBC
233
  _IO_flockfile (stderr);
242
  _IO_flockfile (stderr);
Lines 288-293 error_at_line (int status, int errnum, const char *file_name, Link Here
288
		   0);
297
		   0);
289
#endif
298
#endif
299
#if !_LIBC
300
  /* POSIX states that fflush (stdout) after fclose is unspecified; it
301
     is safe in glibc, but not on all other platforms.  fflush (NULL)
302
     is always defined, but too draconian.  */
303
  if (0 <= fcntl (1, F_GETFL))
304
#endif
290
  fflush (stdout);
305
  fflush (stdout);
291
#ifdef _LIBC
306
#ifdef _LIBC
292
  _IO_flockfile (stderr);
307
  _IO_flockfile (stderr);
293
- 

Return to bug 10412