diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-11-12 15:18:06 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-11-16 17:03:03 +0100 |
commit | ed304a5d73389023a542841faeb277ccca798549 (patch) | |
tree | cf5da6ca6a0ba8e086513182e804b548026e1b44 /src/basic/mkdir.h | |
parent | tree-wide: don't use mkdir_errno_wrapper() without reason (diff) | |
download | systemd-ed304a5d73389023a542841faeb277ccca798549.tar.xz systemd-ed304a5d73389023a542841faeb277ccca798549.zip |
mkdir: drop mkdir_errno_wrapper(), use mkdirat_errno_wrapper() instead
Let's reduce our code duplication, and let's focus on using xyzat()
style APIs more, hence drop mkdir_errno_wrapper() and stick to
mkdirar_errno_wrapper() wherever we can, it's a true superset of
functionality after all.
Diffstat (limited to 'src/basic/mkdir.h')
-rw-r--r-- | src/basic/mkdir.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/basic/mkdir.h b/src/basic/mkdir.h index 3c53d22db9..837e493c6b 100644 --- a/src/basic/mkdir.h +++ b/src/basic/mkdir.h @@ -8,7 +8,6 @@ typedef enum MkdirFlags { MKDIR_WARN_MODE = 1 << 1, } MkdirFlags; -int mkdir_errno_wrapper(const char *pathname, mode_t mode); int mkdirat_errno_wrapper(int dirfd, const char *pathname, mode_t mode); int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags); int mkdir_parents(const char *path, mode_t mode); @@ -22,9 +21,9 @@ int mkdir_parents_label(const char *path, mode_t mod); int mkdir_p_label(const char *path, mode_t mode); /* internally used */ -typedef int (*mkdir_func_t)(const char *pathname, mode_t mode); -int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir); -int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir); -int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir); +typedef int (*mkdirat_func_t)(int dir_fd, const char *pathname, mode_t mode); +int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdirat_func_t _mkdir); +int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdirat_func_t _mkdir); +int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdirat_func_t _mkdir); int mkdir_p_root(const char *root, const char *p, uid_t uid, gid_t gid, mode_t m); |