Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 253570
Collapse All | Expand All

(-)a/find/ftsfind.c (-22 / +14 lines)
Lines 446-472 consider_visiting(FTS *p, FTSENT *ent) Link Here
446
    }
446
    }
447
  else if (ent->fts_info == FTS_NS)
447
  else if (ent->fts_info == FTS_NS)
448
    {
448
    {
449
      if (ent->fts_level == 0)
449
      error(0, ent->fts_errno, "%s",
450
	{
450
	    safely_quote_err_filename(0, ent->fts_path));
451
	  /* e.g., nonexistent starting point */
451
      error_severity(1);
452
	  error(0, ent->fts_errno, "%s",
452
      /* Continue despite the error, as file name without stat info
453
		safely_quote_err_filename(0, ent->fts_path));
453
       * might be better than not even processing the file name. This
454
	  error_severity(1);	/* remember problem */
454
       * can lead to repeated error messages later on, though, if a
455
	  return;
455
       * predicate requires stat information.
456
	}
456
       *
457
      else
457
       * Not printing an error message here would be even more wrong,
458
	{
458
       * though, as this could cause the contents of a directory to be
459
	  /* The following if statement fixes Savannah bug #19605
459
       * silently ignored, as the directory wouldn't be identified as
460
	   * (failure to diagnose a symbolic link loop)
460
       * such.
461
	   */
461
       */
462
	  if (symlink_loop(ent->fts_accpath))
463
	    {
464
	      error(0, ELOOP, "%s",
465
		    safely_quote_err_filename(0, ent->fts_path));
466
	      error_severity(1);
467
	      return;
468
	    }
469
	}
470
    }
462
    }
471
463
472
  /* Cope with the usual cases. */
464
  /* Cope with the usual cases. */
Lines 474-480 consider_visiting(FTS *p, FTSENT *ent) Link Here
474
      || ent->fts_info == FTS_NS /* e.g. symlink loop */)
466
      || ent->fts_info == FTS_NS /* e.g. symlink loop */)
475
    {
467
    {
476
      assert (!state.have_stat);
468
      assert (!state.have_stat);
477
      assert (ent->fts_info == FTS_NSOK || state.type != 0);
469
      assert (ent->fts_info == FTS_NSOK || state.type == 0);
478
      mode = state.type;
470
      mode = state.type;
479
    }
471
    }
480
  else
472
  else
(-)a/find/util.c (-5 / +7 lines)
Lines 214-219 get_statinfo (const char *pathname, const char *name, struct stat *p) Link Here
214
	{
214
	{
215
	  if (!options.ignore_readdir_race || (errno != ENOENT) )
215
	  if (!options.ignore_readdir_race || (errno != ENOENT) )
216
	    {
216
	    {
217
              /* FIXME: this error message might repeat the one from
218
               * the FTS_NS case in consider_visiting. How to avoid this?
219
               */
217
	      error (0, errno, "%s",
220
	      error (0, errno, "%s",
218
		     safely_quote_err_filename(0, pathname));
221
		     safely_quote_err_filename(0, pathname));
219
	      state.exit_status = 1;
222
	      state.exit_status = 1;
Lines 270-275 get_info (const char *pathname, Link Here
270
      int result = get_statinfo(pathname, state.rel_pathname, p);
273
      int result = get_statinfo(pathname, state.rel_pathname, p);
271
      if (result != 0)
274
      if (result != 0)
272
	{
275
	{
276
	  return -1;		/* failure. */
277
	}
278
      else
279
	{
273
	  /* Verify some postconditions.  We can't check st_mode for
280
	  /* Verify some postconditions.  We can't check st_mode for
274
	     non-zero-ness because of Savannah bug #16378 (which is
281
	     non-zero-ness because of Savannah bug #16378 (which is
275
	     that broken NFS servers can return st_mode==0). */
282
	     that broken NFS servers can return st_mode==0). */
Lines 281-290 get_info (const char *pathname, Link Here
281
	    {
288
	    {
282
	      assert (p->st_ino);
289
	      assert (p->st_ino);
283
	    }
290
	    }
284
	  return -1;		/* failure. */
285
	}
286
      else
287
	{
288
	  return 0;		/* success. */
291
	  return 0;		/* success. */
289
	}
292
	}
290
    }
293
    }
291
- 

Return to bug 253570