bug-coreutils
[Top][All Lists]
Advanced

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

coreutils 6.0, cygwin build failure


From: Eric Blake
Subject: coreutils 6.0, cygwin build failure
Date: Tue, 15 Aug 2006 21:50:33 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

On cygwin:

if gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I..  -I.. -I. -I../lib -I../lib -
I/usr/local/include  -g -O2 -MT stat.o -MD -MP -MF ".deps/stat.Tpo" -c -o 
stat.o stat.c; \
        then mv -f ".deps/stat.Tpo" ".deps/stat.Po"; else rm -
f ".deps/stat.Tpo"; exit 1; fi
stat.c: In function `human_fstype':
stat.c:147: error: structure has no member named `f_type'
stat.c:284: error: structure has no member named `f_type'
make[3]: *** [stat.o] Error 1

I've known about it and patched it in my local tree since April, but my patch 
in savannah was unfortunately never applied:

http://savannah.gnu.org/bugs/?func=detailitem&item_id=16325

2006-04-17 Eric Blake <address@hidden>

        * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but
        statvfs.f_type not present.

Once that patch is applied, the build completes.  However, since cygwin does 
not (yet) supply openat and friends, and since it has the known bug of 
treating /proc/self/fd/3/.. as /proc/self/fd rather than the actual parent 
directory of where /proc/self/fd/3 is linked to, all the fts-based programs 
fail because they get lost when trying to return to the parent directory.  
Therefore, the entire test suite fails to clean up after itself, since rm -rf 
now uses fts.

A slick workaround for the bulk of these failures is to change the new at-
func.c wrapper to fall back to fchdir when .. is encountered, but 
use /proc/self/fd everywhere else that it works, which reduces but not 
eliminates the number of fchdirs performed in the *at() emulations.  This 
latter patch is not worth incorporating upstream, though, because I am still 
trying to get cygwin to fix their .. handling bug, or at least implement openat 
so that the /proc emulation is not needed.  And even with this patch, there are 
some other testsuite failures, including regressions from 5.97, that I hope to 
track down later as I find time; I suspect many of the regressions are due to 
cygwin bugs tickled by the new fts code, rather than bugs in coreutils proper.

2006-08-15  Eric Blake  <address@hidden>

        * at-func.c (AT_FUNC_NAME) [cygwin]: Avoid `/proc/self/fd/n/..',
        since cygwin has the bug of treating it as `/proc/self/fd'.

Index: lib/at-func.c
===================================================================
RCS file: /sources/coreutils/coreutils/lib/at-func.c,v
retrieving revision 1.1
diff -u -r1.1 at-func.c
--- lib/at-func.c       15 Aug 2006 19:17:30 -0000      1.1
+++ lib/at-func.c       15 Aug 2006 21:43:21 -0000
@@ -38,6 +38,11 @@
   if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
     return CALL_FUNC (file);
 
+#if __CYGWIN__
+  /* On cygwin, open("/proc/self/fd/n/..") incorrectly opens /proc/self/fd,
+     rather than the parent of /proc/self/fd/n.  */
+  if (strcmp (file, ".."))
+#endif /* __CYGWIN__ */
   {
     char *proc_file;
     BUILD_PROC_NAME (proc_file, fd, file);






reply via email to

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