bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Problem with fstatat on AIX 7.1


From: Paul Eggert
Subject: Re: [Bug-tar] Problem with fstatat on AIX 7.1
Date: Mon, 05 Sep 2011 06:52:56 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13

Assuming my guess about openat is right, could you please
try the following patch to gnu/openat.c, and then sending
the 'truss' output from the same test as before?  Thanks.

--- gnu/openat.c-1.26   2011-06-07 14:18:59.506314750 -0700
+++ gnu/openat.c        2011-09-05 06:47:08.820498016 -0700
@@ -18,8 +18,25 @@
 
 /* written by Jim Meyering */
 
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+   the system's <fcntl.h> here, so that orig_openat doesn't recurse to
+   rpl_openat.  */
+#define __need_system_fcntl_h
 #include <config.h>
 
+/* Get the original definition of open.  It might be defined as a macro.  */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+#if HAVE_OPENAT
+static inline int
+orig_openat (int fd, char const *filename, int flags, mode_t mode)
+{
+  return openat (fd, filename, flags, mode);
+}
+#endif
+
 #include "openat.h"
 
 #include <stdarg.h>
@@ -33,8 +50,6 @@
 
 #if HAVE_OPENAT
 
-# undef openat
-
 /* Like openat, but work around Solaris 9 bugs with trailing slash.  */
 int
 rpl_openat (int dfd, char const *filename, int flags, ...)
@@ -88,7 +103,7 @@ rpl_openat (int dfd, char const *filenam
     }
 # endif
 
-  fd = openat (dfd, filename, flags, mode);
+  fd = orig_openat (dfd, filename, flags, mode);
 
 # if OPEN_TRAILING_SLASH_BUG
   /* If the filename ends in a slash and fd does not refer to a directory,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]