Re: rm: avoiding a race condition on non-glibc systems

2005-05-17 Thread Paul Eggert
Eric Blake [EMAIL PROTECTED] writes: This change broke cygwin. Cygwin does not have struct dirent.d_type, so DT_IS_DIR is defined as do_not_use_this_macro. I think protecting this if statement with HAVE_STRUCT_DIRENT_D_TYPE, and letting cygwin fall through to the unlink, will fix the

Re: rm: avoiding a race condition on non-glibc systems

2005-05-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Paul Eggert on 5/13/2005 4:55 PM: 2005-05-13 Paul Eggert [EMAIL PROTECTED] * m4/prereqs.m4 (gl_PREREQ): Require gl_UNLINKDIR. * src/remove.c: Include unlinkdir.h. (UNLINK_CAN_UNLINK_DIRS): Remove.

Re: rm: avoiding a race condition on non-glibc systems

2005-05-14 Thread Jim Meyering
Paul Eggert [EMAIL PROTECTED] wrote: ... How about this patch? It incorporates the above ideas. 2005-05-13 Paul Eggert [EMAIL PROTECTED] * m4/prereqs.m4 (gl_PREREQ): Require gl_UNLINKDIR. * src/remove.c: Include unlinkdir.h. (UNLINK_CAN_UNLINK_DIRS): Remove.

Re: rm: avoiding a race condition on non-glibc systems

2005-05-14 Thread Paul Eggert
Jim Meyering [EMAIL PROTECTED] writes: That looks fine, and works fine here. Please commit it. OK, done. I also added Cygwin to the list of platforms that can't unlink directories, as Eric Blake suggested. ___ Bug-coreutils mailing list

Re: rm: avoiding a race condition on non-glibc systems

2005-05-14 Thread Jim Meyering
Paul Eggert [EMAIL PROTECTED] wrote: Jim Meyering [EMAIL PROTECTED] writes: That looks fine, and works fine here. Please commit it. OK, done. I also added Cygwin to the list of platforms that can't unlink directories, as Eric Blake suggested. Thanks! I found that it needed a little

Re: rm: avoiding a race condition on non-glibc systems

2005-05-13 Thread Paul Eggert
Jim Meyering [EMAIL PROTECTED] writes: So the current test of __GLIBC__ may be wrong if the underlying kernel is not Linux. A few thoughts. It'd be nice to factor out this can unlink(2) remove directories business into a gnulib module. Tar could use it, for example. On traditional Unix,