bug#80856: [PATCH] chcon, chmod, chown, rm: improve fts_read failure diagnostic

Collin Funk <[email protected]> Sat, 18 Apr 2026 22:13:52 -0700
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
Paul Eggert <[email protected]> writes:

> I thought that fts_path had unreliable contents after fts_read fails,
> which would mean the proposed patch would lead to unreliable behavior.
> What am I missing?

In src/du.c we have the following:

          ent = fts_read (fts);
          if (ent == NULL)
            {
              if (errno != 0)
                {
                  error (0, errno, _("fts_read failed: %s"),
                         quotef (fts->fts_path));
                  ok = false;
                }

Perhaps that should be changed? I'm not sure of that behavior, to be
honest.

Collin