summaryrefslogtreecommitdiffstats
path: root/src/basic
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-10-13 05:07:25 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-10-15 12:09:38 +0200
commit28b9c823c7b488b00f0faf30ab7c8930241c881f (patch)
tree20b06cdbb9ae1bd28315dc6a20c878118f77d8ea /src/basic
parentbusctl: minor coding style cleanups (diff)
downloadsystemd-28b9c823c7b488b00f0faf30ab7c8930241c881f.tar.xz
systemd-28b9c823c7b488b00f0faf30ab7c8930241c881f.zip
fs-util: make readlink_malloc() inline
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/fs-util.c4
-rw-r--r--src/basic/fs-util.h6
2 files changed, 4 insertions, 6 deletions
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
index a6b53e7067..9292e567c8 100644
--- a/src/basic/fs-util.c
+++ b/src/basic/fs-util.c
@@ -153,10 +153,6 @@ int readlinkat_malloc(int fd, const char *p, char **ret) {
}
}
-int readlink_malloc(const char *p, char **ret) {
- return readlinkat_malloc(AT_FDCWD, p, ret);
-}
-
int readlink_value(const char *p, char **ret) {
_cleanup_free_ char *link = NULL, *name = NULL;
int r;
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
index 82e865180b..702b6010e2 100644
--- a/src/basic/fs-util.h
+++ b/src/basic/fs-util.h
@@ -28,9 +28,11 @@ int rmdir_parents(const char *path, const char *stop);
int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
int readlinkat_malloc(int fd, const char *p, char **ret);
-int readlink_malloc(const char *p, char **r);
+static inline int readlink_malloc(const char *p, char **ret) {
+ return readlinkat_malloc(AT_FDCWD, p, ret);
+}
int readlink_value(const char *p, char **ret);
-int readlink_and_make_absolute(const char *p, char **r);
+int readlink_and_make_absolute(const char *p, char **ret);
int chmod_and_chown_at(int dir_fd, const char *path, mode_t mode, uid_t uid, gid_t gid);
static inline int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) {