stat-util: fix dir_is_empty_at without path
authorLuca Boccassi <luca.boccassi@microsoft.com>
Mon, 18 Jan 2021 20:15:03 +0000 (20:15 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 16 Feb 2021 19:24:27 +0000 (20:24 +0100)
commitb8f762f2fe59c94323c95d2aadea68612dca2b04
treeb6e08549cda83946ea58eb1a3b4b3566ca081d7e
parent42b23010b9e74a2a59cc1f8533ef45b69d4fba47
stat-util: fix dir_is_empty_at without path

Use the right FD, and do a fd_reopen instead of a dup, since the
latter will still share the internal pointer which then gets
moved by FOREACH_DIRENT, affecting the caller's FD.
src/basic/stat-util.c