[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: another tiny closeout.c change
From: |
Jim Meyering |
Subject: |
FYI: another tiny closeout.c change |
Date: |
Mon, 22 Nov 2004 15:27:02 +0100 |
I've just done this in coreutils, in case EBADF is not
defined on some system. Do any of you know of a system
(reasonable porting target) for which <errno.h> does not define EBADF?
2004-11-22 Jim Meyering <address@hidden>
* closeout.c (EBADF): Fail with `#error ...' if it's not defined,
asking the user to report the problem.
Index: lib/closeout.c
===================================================================
RCS file: /fetish/cu/lib/closeout.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -u -r1.17 -r1.18
--- lib/closeout.c 14 Nov 2004 00:20:01 -0000 1.17
+++ lib/closeout.c 22 Nov 2004 14:24:04 -0000 1.18
@@ -39,6 +39,13 @@
# include "unlocked-io.h"
#endif
+/* If EBADF is not defined then the code below can't possibly work --
+ we'll need to know what value errno is set to when fclose fails to
+ close an already-closed stream. Ask the user to report it. */
+#ifndef EBADF
+# error "EBADF is not defined: please report this to address@hidden"
+#endif
+
static const char *file_name;
/* Set the file name to be reported in the event an error is detected
- FYI: another tiny closeout.c change,
Jim Meyering <=