]> git.ipfire.org Git - thirdparty/systemd.git/commit
dirent-util: tweak readdir_ensure_type() a bit 20962/head
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Oct 2021 20:58:43 +0000 (22:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Oct 2021 21:13:40 +0000 (23:13 +0200)
commit49a0931f625127a7cdbb02b6a9119119a2f7e1a7
tree4cbe3e9ff88a770b71471b4e417a6843c858df69
parent3214129369a0daa6558565a93aa17eb8ada69bc3
dirent-util: tweak readdir_ensure_type() a bit

So far we ignored if readdir_ensure_type() failed, the .d_type would
then still possibly report DT_UNKNOWN, possibly confusing the caller.

Let's make this safer: if we get an error on readdir_ensure_type() then
report it — except if it is ENOENT which indicates the dirent vanished
by now, which is not a problem and we should just skip to the next
entry.
src/basic/dirent-util.c