Every one of locate's stdout output paths uses print!/println!, which panic on a failed write.
The affected output paths (src/locate/mod.rs):
--version — print!("{}", app.render_version()) (mod.rs:599)
- match output —
println!("{}", …) / print!("{}\0", …) (mod.rs:649/651)
-c / count — println!("{count}") (mod.rs:671)
-S / --statistics — the whole Statistics::print / print_header
block, ~10 println! calls (mod.rs:117–144)
$ locate --version > /dev/full
thread 'main' panicked at library/std/src/io/stdio.rs:1165:9:
failed printing to stdout: No space left on device (os error 28)
$ echo $?
101
$ printf '\0LOCATE02\0\0/foo\0' > /tmp/db.bin
$ locate --statistics -d /tmp/db.bin foo > /dev/full
thread 'main' panicked at library/std/src/io/stdio.rs:1165:9: ...
$ locate -d /tmp/db.bin foo > /dev/full # match output
thread 'main' panicked at library/std/src/io/stdio.rs:1165:9: ...
$ locate -c -d /tmp/db.bin foo > /dev/full # count output
thread 'main' panicked at library/std/src/io/stdio.rs:1165:9: ...
$ echo $?
101
Every one of
locate's stdout output paths usesprint!/println!, which panic on a failed write.The affected output paths (
src/locate/mod.rs):--version—print!("{}", app.render_version())(mod.rs:599)println!("{}", …)/print!("{}\0", …)(mod.rs:649/651)-c/ count —println!("{count}")(mod.rs:671)-S/--statistics— the wholeStatistics::print/print_headerblock, ~10
println!calls (mod.rs:117–144)