bug-coreutils
[Top][All Lists]
Advanced

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

bug#8230: touch dumps core on solaris 10


From: Bruno Haible
Subject: bug#8230: touch dumps core on solaris 10
Date: Sat, 12 Mar 2011 13:11:51 +0100
User-agent: KMail/1.9.9

Paul Eggert wrote:
> That sounds good, but why make Solaris 9 a special case?
> Wouldn't it be simpler to do it for all platforms where gnulib
> defines futimens or utimensat functions?

The functions of the two cycles are available on the following platforms:

Cycle #1:
  futimens    AIX 7, Cygwin 1.7, Solaris >= 10
  fdutimens   none
  futimesat   Cygwin 1.7, Solaris >= 9

Cycle #2:
  utimensat   AIX 7, Cygwin 1.7, Solaris >= 10
  utimens     none
  futimesat   Cygwin 1.7, Solaris >= 9

On AIX, there's no problem, because AIX does not use the ELF format, therefore
a function definition in an executable cannot change how libc behaves. And on
Cygwin, all functions appeared at the same time.

I'm applying this patch:


2011-03-12  Bruno Haible  <address@hidden>

        futimens, utimensat: Avoid endless recursion on Solaris 10.
        * lib/sys_stat.in.h (futimens, utimensat): Define with rpl_ prefix on
        Solaris.
        Reported by Ben Walton <address@hidden> via Eric Blake
        in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8230>.

--- lib/sys_stat.in.h.orig      Sat Mar 12 12:51:25 2011
+++ lib/sys_stat.in.h   Sat Mar 12 12:50:23 2011
@@ -355,7 +355,11 @@
 
 
 #if @GNULIB_FUTIMENS@
-# if @REPLACE_FUTIMENS@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
+   implementation relies on futimesat, which on Solaris 10 makes an invocation
+   to futimens that is meant to invoke the libc's futimens(), not gnulib's
+   futimens().  */
+# if @REPLACE_FUTIMENS@ || defined __sun
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef futimens
 #   define futimens rpl_futimens
@@ -368,7 +372,9 @@
 #  endif
 _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
 # endif
+# if @HAVE_FUTIMENS@
 _GL_CXXALIASWARN (futimens);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef futimens
 # if HAVE_RAW_DECL_FUTIMENS
@@ -612,7 +618,11 @@
 
 
 #if @GNULIB_UTIMENSAT@
-# if @REPLACE_UTIMENSAT@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
+   implementation relies on futimesat, which on Solaris 10 makes an invocation
+   to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
+   utimensat().  */
+# if @REPLACE_UTIMENSAT@ || defined __sun
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef utimensat
 #   define utimensat rpl_utimensat
@@ -631,7 +641,9 @@
 _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
                                    struct timespec const times[2], int flag));
 # endif
+# if @HAVE_UTIMENSAT@
 _GL_CXXALIASWARN (utimensat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef utimensat
 # if HAVE_RAW_DECL_UTIMENSAT
-- 
In memoriam Zoran Djindjić <http://en.wikipedia.org/wiki/Zoran_Đinđić>





reply via email to

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