[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #60207] -prune returns false for files for which fstatat() fails wi
From: |
Bernhard Voelker |
Subject: |
[bug #60207] -prune returns false for files for which fstatat() fails with EACCESS |
Date: |
Wed, 10 Mar 2021 09:26:21 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0 |
Follow-up Comment #2, bug #60207 (project findutils):
Thanks for the report.
Hmm, with '-D tree' we can see that -prune inserts a "[call stat] [need
type]".
$ find -D tree -name 'a*' -prune -o -print 2>&1 | sed -n '/^Optimized command
line/{n; s/ .est success rate [0-9.]*.//g; p}'
( -name a* -a [call stat] [need type] -prune ) -o -print
In parser.c, we see that -prune adds it unless -depth is set:
if (options.do_dir_first == false)
our_pred->need_stat = our_pred->need_type = false;
And indeed, adding -depth doesn't yield the extra "[call stat] [need type]".
find -D tree -depth -name 'a*' -prune -o -print 2>&1 | sed -n '/^Optimized
command line/{n; s/ .est success rate [0-9.]*.//g; p}'
( ( -depth -a -name a* ) -a -prune ) -o -print
The condition has been added in commit
https://git.sv.gnu.org/cgit/findutils.git/commit/?id=d62aacb1b
The question is why? It seems that this because -prune uses S_ISDIR()
stop at the current level ... have to investigate.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60207>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/