Re: Possible spurious cycle detection with fts

2005-08-24 Thread Paul Eggert
Jim Meyering [EMAIL PROTECTED] writes:

 I'll hold off on the commit until Paul signs off on it.

That looks good to me.  Thanks for doing the merge.


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: Possible spurious cycle detection with fts

2005-08-24 Thread Jim Meyering
I've just committed that patch.

Jim Meyering [EMAIL PROTECTED] wrote:
...
 Thanks for reporting that.
 With the following changes,
   ./gnulib-tool --test fts
 once again passes.

 2005-08-24  Jim Meyering  [EMAIL PROTECTED]

   * modules/fcntl-safer: New module.
   * modules/fts (Depends-on): Add fcntl-safer.
   * MODULES.html.sh (File descriptor based Input/Output):
   Add fcntl-safer.

 m4:
 2005-08-24  Jim Meyering  [EMAIL PROTECTED]

   Sync from coreutils.
   * fcntl-safer.m4: New file.

 lib:
 2005-08-24  Jim Meyering  [EMAIL PROTECTED]

   Sync from coreutils.
   * fcntl--.h, fcntl-safer.h, open-safer.c: New files.


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: Possible spurious cycle detection with fts

2005-08-10 Thread Jim Meyering
James Youngman [EMAIL PROTECTED] wrote:
 This patch resolves my problem; thanks.  Might I suggest though that
 you enhance the ChangeLog entry to describe the problem as well as the
 solution?

This change requires some comment changes, too.
I'll do both.


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: Possible spurious cycle detection with fts

2005-08-09 Thread Jim Meyering
James Youngman [EMAIL PROTECTED] wrote:
 If I invoke fts_open() with the FTS_LOGICAL flag and do not set
 FTS_TIGHT_CYCLE_CHECK, then fts_read() returns FTS_DC in
 ent-fts_info.  However, with the same directory layout FTS_DC is not
 set if FTS_TIGHT_CYCLE_CHECK is set.

 fts_options   Result
 FTS_NOSTAT|FTS_LOGICAL|FTS_TIGHT_CYCLE_CHECKOK
 FTS_NOSTAT|FTS_LOGICAL  Loop (wrongly) detected
 FTS_NOSTAT|FTS_PHYSICAL   OK

Hi James,

Thanks for reporting that.
You're right that fts cycle detection could
get false positives with FTS_NOSTAT|FTS_LOGICAL.
Here's a barely-tested fix (tested only with an instrumented chown-core.c
via `chown -RL' since I don't have the latest find sources here):

Barring negative feedback, I'll check it in to gnulib
in a day or two.

2005-08-09  Jim Meyering  [EMAIL PROTECTED]

* fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
Use the hash-table-based cycle-detection code not just when
FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
Reported by James Youngman

Index: lib/fts-cycle.c
===
RCS file: /home/meyering/tmp/cu-repo/cu/lib/fts-cycle.c,v
retrieving revision 1.2
diff -u -p -r1.2 fts-cycle.c
--- lib/fts-cycle.c 21 May 2005 06:42:41 -  1.2
+++ lib/fts-cycle.c 9 Aug 2005 14:47:09 -
@@ -50,7 +50,7 @@ AD_hash (void const *x, size_t table_siz
 static bool
 setup_dir (FTS *fts)
 {
-  if (fts-fts_options  FTS_TIGHT_CYCLE_CHECK)
+  if (fts-fts_options  (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
 {
   enum { HT_INITIAL_SIZE = 31 };
   fts-fts_cycle.ht = hash_initialize (HT_INITIAL_SIZE, NULL, AD_hash,
@@ -74,7 +74,7 @@ setup_dir (FTS *fts)
 static bool
 enter_dir (FTS *fts, FTSENT *ent)
 {
-  if (fts-fts_options  FTS_TIGHT_CYCLE_CHECK)
+  if (fts-fts_options  (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
 {
   struct stat const *st = ent-fts_statp;
   struct Active_dir *ad = malloc (sizeof *ad);
@@ -125,7 +125,7 @@ enter_dir (FTS *fts, FTSENT *ent)
 static void
 leave_dir (FTS *fts, FTSENT *ent)
 {
-  if (fts-fts_options  FTS_TIGHT_CYCLE_CHECK)
+  if (fts-fts_options  (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
 {
   struct stat const *st = ent-fts_statp;
   struct Active_dir obj;
@@ -144,7 +144,7 @@ leave_dir (FTS *fts, FTSENT *ent)
 static void
 free_dir (FTS *sp)
 {
-  if (sp-fts_options  FTS_TIGHT_CYCLE_CHECK)
+  if (sp-fts_options  (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
 {
   if (sp-fts_cycle.ht)
hash_free (sp-fts_cycle.ht);


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib