If both <errno.h> and <sys/errno.h> exist, include only <errno.h>, don't
authorChristos Zoulas <christos@zoulas.com>
Wed, 28 Oct 2009 13:12:08 +0000 (09:12 -0400)
committerChristos Zoulas <christos@zoulas.com>
Wed, 28 Oct 2009 13:12:08 +0000 (09:12 -0400)
include both and manually define errno.

ChangeLog
include/am_defs.h

index 3dc67728e3a27fc2ca5bed77d8ef7012ca4e9d93..16c561e9ff76d54ecf4689d7e26b044b7425034f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-27  Christos Zoulas <christos@zoulas.com>
+
+       * Deal with errno.h->sys/errno.h better
+
 2009-10-26  Christos Zoulas <christos@zoulas.com>
 
        * Fix issue with autoconf 2.63
index a74d0609d8325858f9e481e10a954e452da4ed80..b38b1ee9ab74f6dfddee53dafda6e0fdd7e305be 100644 (file)
@@ -325,14 +325,6 @@ typedef bool_t (*xdrproc_t) __P ((XDR *, __ptr_t, ...));
 # include <mntent.h>
 #endif /* HAVE_MNTENT_H */
 
-/*
- * Actions to take if <sys/errno.h> exists.
- */
-#ifdef HAVE_SYS_ERRNO_H
-# include <sys/errno.h>
-extern int errno;
-#endif /* HAVE_SYS_ERRNO_H */
-
 /*
  * Actions to take if <sys/fsid.h> exists.
  */
@@ -937,6 +929,14 @@ struct sockaddr_dl;
  */
 #ifdef HAVE_ERRNO_H
 # include <errno.h>
+#else
+/*
+ * Actions to take if <sys/errno.h> exists.
+ */
+# ifdef HAVE_SYS_ERRNO_H
+#  include <sys/errno.h>
+extern int errno;
+# endif /* HAVE_SYS_ERRNO_H */
 #endif /* HAVE_ERRNO_H */
 
 /*