summaryrefslogtreecommitdiffstats
path: root/eval.c
AgeCommit message (Collapse)Author
2019-05-05color: Don't stat() if we don't need toTavian Barnes
2019-05-05bftw: Pass a const struct BFTW * to the callbackTavian Barnes
2019-05-04bftw: Add a caching stat() API to struct BFTWTavian Barnes
2019-05-04stat: Unify the flags argumentsTavian Barnes
2019-04-15Release 1.41.4Tavian Barnes
2019-03-07eval: Fix -unique with -depthTavian Barnes
2019-03-06bftw: Work around d_type being wrong for bind mounts on LinuxTavian Barnes
C.f. https://savannah.gnu.org/bugs/?54913 C.f. https://lkml.org/lkml/2019/2/11/2027 Fixes https://github.com/tavianator/bfs/issues/37
2019-03-06bftw: Switch from taking separate parameters to a parameters structTavian Barnes
2019-03-06parse: Use a trie to hold currently open filesTavian Barnes
2019-03-04trie: Revamp the API to support mappingsTavian Barnes
2019-03-01Implement -uniqueTavian Barnes
Closes #48
2019-02-09Add some documentation commentsTavian Barnes
2019-02-06Fix -nouser/-nogroup error handlingTavian Barnes
The proper way to check for nonexistent users/groups is to set errno to 0 before the get{grg,pwu}id() call, and check it afterwards. On doing this, it becomes obvious that the call can fail if bftw() is using all the available FDs, so give them some ephemeral FDs. It would be ideal to read the user/group table only once, but this fixes the bug for now.
2019-02-01eval: Fix wrong colors in error messagesTavian Barnes
When reporting an error, we should try to stat the file first so the message can have the right colors.
2019-01-11parse: Allow multiple comma-separated debug flagsTavian Barnes
2019-01-02posix1e: Split out ACL and capability handling from utilTavian Barnes
2019-01-02color: Check format strings + args for cfprintf()Tavian Barnes
%{cc} is now ${cc} to avoid warnings about an unrecognized format specifier, and %P and %L are now %pP and %pL to make them look more like standard format strings.
2019-01-02diag: Unify diagnostic formattingTavian Barnes
This adds a bfs: prefix to error/warning messages for consistency with other command line tools, and leaves only the "error:"/"warning:" part colored like GCC. It also uniformly adds full stops after messages.
2018-12-25stat: Provide a helper for getting human-readable field namesTavian Barnes
And fix -newerXY if the Y time doesn't exist.
2018-12-20stat: Unify bfs_stat_time() implementationsTavian Barnes
2018-12-19stat: Handle statx() not returning some timesTavian Barnes
/sys/fs/cgroup, for example, doesn't return access times from statx(). That shouldn't matter unless we actually need them, so make it not an error.
2018-12-17Implement -acl testTavian Barnes
2018-12-17Add new -capable testTavian Barnes
2018-12-17bftw: Move bftw_typeflag conversion out of utilTavian Barnes
Turns out incomplete enum types are a GNU C extension.
2018-11-01Print device major/minor numbers for -lsTavian Barnes
2018-09-24Update copyright datesTavian Barnes
2018-07-24stat: Don't assume blocks are 512 bytesTavian Barnes
POSIX says > The unit for the st_blocks member of the stat structure is not defined > within POSIX.1‐2008. and recommends using DEV_BSIZE from <sys/param.h> if available. Also, for -printf '%S', print 1 instead of NaN for empty files with no blocks.
2018-07-15eval: Debug all stat() callsTavian Barnes
2018-07-12eval: Share the statbuf across multiple -xtype'sTavian Barnes
2018-07-12eval: Get rid of duplicate statbuf fieldTavian Barnes
Also shorten eval_bfs_stat() to eval_stat(). Looks like this was leftover from an incomplete conversion a while ago.
2018-07-12eval: Fix -delete when following symlinks.Tavian Barnes
Same bug as https://savannah.gnu.org/bugs/?46305. Please don't ever do this though.
2018-06-19eval: Don't use %m to report a non-errno errorTavian Barnes
Fixes: 2a45ad01e211d0b36056c21d5211be46195b273d
2018-02-01eval: Don't unnecessarily zero fields in struct eval_stateTavian Barnes
The designated initializer causes everything not mentioned to be zeroed, a waste of time that shows up on profiles. It also has the potential to hide uninitialized-use bugs.
2018-01-08stat: New wrapper around the stat() familyTavian Barnes
This lets bfs transparently support the new statx() system call on Linux, giving it access to file birth times.
2017-12-15Keep track of required FDs per-exprTavian Barnes
2017-11-13color: Implement %m for cfprintf()Tavian Barnes
2017-11-12exec: Fix error reportingTavian Barnes
2017-11-12cmdline: Account for files opened during/between evaluations more carefullyTavian Barnes
2017-11-05Add support for file birth/creation times on platforms that have itTavian Barnes
Fixes #19
2017-10-22Use "error:" prefix consistentlyTavian Barnes
2017-09-20util: Wrap faccessat() to fix some portability issuesTavian Barnes
2017-09-17opt: Move some aggressive optimizations back to -O4Tavian Barnes
2017-09-16opt: Separate optimization from parsingTavian Barnes
2017-09-09eval: Make sure nopenfd >= 2 for bftw()Tavian Barnes
2017-09-09Try /proc/self/fd before /dev/fdTavian Barnes
On Solaris, /proc/self/fd is dynamic while /dev/fd is static.
2017-09-06util: Factor out checks for nonexistent paths/broken linksTavian Barnes
2017-09-02Implement -D searchTavian Barnes
2017-08-27Implement cost-based optimizationTavian Barnes
2017-08-22Avoid multiple extra stat()s of broken symlinks for -xtypeTavian Barnes
2017-08-12Unify broken symlink handlingTavian Barnes
Rather than open-code the fallback logic for broken symlinks everywhere it's needed, introduce a new xfstatat() utility function that performs the fallback automatically. Using xfstatat() consistently fixes a few bugs, including cases where broken symlinks are given as arguments to predicates like -samefile.