renameat: port to Solaris 10, which declares renameat in unistd.h
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 Oct 2010 20:48:34 +0000 (13:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 Oct 2010 20:49:28 +0000 (13:49 -0700)
* lib/renameat.c: Include unistd.h before stdio.h, because
Solaris 10 declares renameat in unistd.h.  Problem encountered
when building GNU tar 1.24 on Solaris 10.

ChangeLog
lib/renameat.c

index f18abb1..38888bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       renameat: port to Solaris 10, which declares renameat in unistd.h
+
+       * lib/renameat.c: Include unistd.h before stdio.h, because
+       Solaris 10 declares renameat in unistd.h.  Problem encountered
+       when building GNU tar 1.24 on Solaris 10.
+
 2010-10-26  Christian Weisgerber  <naddy@mips.inka.de>  (tiny change)
 
        fdopendir: fix C89 compilation
index f294765..692fd52 100644 (file)
 
 #include <config.h>
 
+/* Solaris 10, which predates POSIX-2008, declares its renameat in
+   unistd.h.  Include unistd.h before including stdio.h, so that
+   gnulib's stdio.h doesn't #define renameat to rpl_renameat before
+   Solaris 10's unistd.h declares the system renameat.  */
+#include <unistd.h>
+
 #include <stdio.h>
 
 #if HAVE_RENAMEAT