Assorted cleanups for #42978 (#43051)

https://github.com/systemd/systemd/pull/42978
This commit is contained in:
Yu Watanabe
2026-07-21 14:03:49 +09:00
committed by GitHub
2 changed files with 3 additions and 9 deletions
+2 -8
View File
@@ -444,14 +444,8 @@ int rm_rf_at(int dir_fd, const char *path, RemoveFlags flags) {
/* We refuse to clean the root file system with this call. This is extra paranoia to never cause a
* really seriously broken system. */
r = path_is_root_at(dir_fd, path);
if (r == -ENOENT) {
struct stat st;
if (fstatat(dir_fd, path, &st, AT_SYMLINK_NOFOLLOW) < 0)
r = -errno;
else
r = 0; /* The entry exists, but is most likely a dangling symlink. */
}
if (r == -ENOENT)
r = RET_NERRNO(faccessat(dir_fd, path, F_OK, AT_SYMLINK_NOFOLLOW));
if (FLAGS_SET(flags, REMOVE_MISSING_OK) && r == -ENOENT)
return 0;
if (r < 0)
+1 -1
View File
@@ -297,7 +297,7 @@ static int is_fs_fully_userns_compatible(const struct statfs *sfs) {
static int recurse_fd(int input_fd, const struct stat *st, uid_t shift, bool is_toplevel) {
_cleanup_closedir_ DIR *d = NULL;
_cleanup_close_ int fd = input_fd;
_cleanup_close_ int fd = TAKE_FD(input_fd);
bool changed = false;
struct statfs sfs;
int r;