stat-util: replace is_dir() + is_dir_fd() by single is_dir_full() call

This new call can execute both of the old operations, but also do
generic fstatat() like behaviour.
This commit is contained in:
Lennart Poettering
2022-07-14 10:11:50 +02:00
parent 3f0dbb0f0c
commit a586dc791c
2 changed files with 13 additions and 16 deletions
+7 -2
View File
@@ -13,8 +13,13 @@
#include "missing_stat.h"
int is_symlink(const char *path);
int is_dir(const char *path, bool follow);
int is_dir_fd(int fd);
int is_dir_full(int atfd, const char *fname, bool follow);
static inline int is_dir(const char *path, bool follow) {
return is_dir_full(AT_FDCWD, path, follow);
}
static inline int is_dir_fd(int fd) {
return is_dir_full(fd, NULL, false);
}
int is_device_node(const char *path);
int dir_is_empty_at(int dir_fd, const char *path, bool ignore_hidden_or_backup);