summaryrefslogtreecommitdiffstats
path: root/main.c
Commit message (Collapse)AuthorAgeFilesLines
* util: Move redirect() and isopen() to main.cTavian Barnes2020-10-011-0/+22
|
* Rename struct cmdline to bfs_ctxTavian Barnes2020-09-271-11/+13
| | | | | The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab.
* pwcache: Rename from passwd.[ch]Tavian Barnes2020-04-221-1/+1
|
* passwd: Cache the user/group tablesTavian Barnes2020-02-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | This is a significant optimization for conditions that need these tables: Benchmark #1: ./bfs ~/code/linux -nouser >/dev/null Time (mean ± σ): 232.0 ms ± 2.5 ms [User: 44.3 ms, System: 185.0 ms] Range (min … max): 228.7 ms … 238.7 ms 12 runs Benchmark #2: ./bfs-1.6 ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.050 s ± 0.012 s [User: 544.2 ms, System: 500.0 ms] Range (min … max): 1.025 s … 1.063 s 10 runs Benchmark #3: find ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.040 s ± 0.012 s [User: 533.6 ms, System: 500.6 ms] Range (min … max): 1.017 s … 1.054 s 10 runs Summary './bfs ~/code/linux -nouser >/dev/null' ran 4.48 ± 0.07 times faster than 'find ~/code/linux -nouser >/dev/null' 4.52 ± 0.07 times faster than './bfs-1.6 ~/code/linux -nouser >/dev/null'
* time: Split out time-related functions from utilTavian Barnes2020-02-131-0/+1
|
* main: Add darray.[ch] to the indexTavian Barnes2019-09-121-0/+1
|
* main: Update comment for fsadeTavian Barnes2019-06-161-1/+1
|
* main: Add pointer to trie.[ch]Tavian Barnes2019-03-171-0/+1
|
* Add some documentation commentsTavian Barnes2019-02-091-0/+31
|
* Turn on -Wstrict-prototypesTavian Barnes2019-02-061-1/+1
|
* main: Fix closed standard stream handlingTavian Barnes2019-02-011-15/+25
| | | | | bfs >&- should complain about a missing file descriptor, rather than silently succeeding.
* Report errors that occur when closing filesTavian Barnes2017-10-211-1/+3
| | | | Otherwise we miss write errors that occur when flushing the cache.
* opt: Separate optimization from parsingTavian Barnes2017-09-161-1/+1
|
* Re-license under the BSD Zero Clause LicenseTavian Barnes2017-07-271-10/+15
|
* main: Call setlocale() at startup to use the system localeTavian Barnes2017-07-201-0/+4
|
* Implement -exit [STATUS]Tavian Barnes2017-07-201-3/+1
| | | | From NetBSD again.
* main: Fix error checking of redirect()Tavian Barnes2017-05-061-1/+3
|
* Update some copyright dates.Tavian Barnes2016-11-241-1/+1
|
* Redirect stdin from /dev/null for -ok and -okdir.Tavian Barnes2016-11-131-32/+4
|
* main: IN is read, OUT is write.Tavian Barnes2016-10-181-3/+3
| | | | Oops :/
* main: Make sure that STD{IN,OUT,ERR}_FILENO are open.Tavian Barnes2016-10-161-0/+59
| | | | | Otherwise invocations like bfs >&- may do weird things like try to write to directory descriptors.
* More s/cl/cmdline/.Tavian Barnes2016-02-131-4/+4
|
* Don't use typedefs to avoid struct/enum tags.Tavian Barnes2016-02-041-1/+1
|
* Split out parsing code.Tavian Barnes2015-11-291-0/+27