diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-14 19:02:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 19:02:29 +0100 |
commit | fbd0b64f44a7bae678137d67ad5da202f6b8d809 (patch) | |
tree | 0402dca4e258583e009d07c0d8eb9c0fad19d5ac /src/core/dynamic-user.c | |
parent | Merge pull request #7610 from poettering/stdio-nolocking (diff) | |
download | systemd-fbd0b64f44a7bae678137d67ad5da202f6b8d809.tar.xz systemd-fbd0b64f44a7bae678137d67ad5da202f6b8d809.zip |
tree-wide: make use of new STRLEN() macro everywhere (#7639)
Let's employ coccinelle to do this for us.
Follow-up for #7625.
Diffstat (limited to 'src/core/dynamic-user.c')
-rw-r--r-- | src/core/dynamic-user.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/dynamic-user.c b/src/core/dynamic-user.c index c4198ac40e..3da31bf870 100644 --- a/src/core/dynamic-user.c +++ b/src/core/dynamic-user.c @@ -147,7 +147,7 @@ static int dynamic_user_acquire(Manager *m, const char *name, DynamicUser** ret) static int make_uid_symlinks(uid_t uid, const char *name, bool b) { - char path1[strlen("/run/systemd/dynamic-uid/direct:") + DECIMAL_STR_MAX(uid_t) + 1]; + char path1[STRLEN("/run/systemd/dynamic-uid/direct:") + DECIMAL_STR_MAX(uid_t) + 1]; const char *path2; int r = 0, k; @@ -175,7 +175,7 @@ static int make_uid_symlinks(uid_t uid, const char *name, bool b) { r = k; } - if (b && symlink(path1 + strlen("/run/systemd/dynamic-uid/direct:"), path2) < 0) { + if (b && symlink(path1 + STRLEN("/run/systemd/dynamic-uid/direct:"), path2) < 0) { k = log_warning_errno(errno, "Failed to symlink \"%s\": %m", path2); if (r == 0) r = k; @@ -218,7 +218,7 @@ static int pick_uid(char **suggested_paths, const char *name, uid_t *ret_uid) { (void) mkdir("/run/systemd/dynamic-uid", 0755); for (;;) { - char lock_path[strlen("/run/systemd/dynamic-uid/") + DECIMAL_STR_MAX(uid_t) + 1]; + char lock_path[STRLEN("/run/systemd/dynamic-uid/") + DECIMAL_STR_MAX(uid_t) + 1]; _cleanup_close_ int lock_fd = -1; uid_t candidate; ssize_t l; @@ -411,7 +411,7 @@ static int dynamic_user_push(DynamicUser *d, uid_t uid, int lock_fd) { } static void unlink_uid_lock(int lock_fd, uid_t uid, const char *name) { - char lock_path[strlen("/run/systemd/dynamic-uid/") + DECIMAL_STR_MAX(uid_t) + 1]; + char lock_path[STRLEN("/run/systemd/dynamic-uid/") + DECIMAL_STR_MAX(uid_t) + 1]; if (lock_fd < 0) return; @@ -744,7 +744,7 @@ void dynamic_user_vacuum(Manager *m, bool close_user) { } int dynamic_user_lookup_uid(Manager *m, uid_t uid, char **ret) { - char lock_path[strlen("/run/systemd/dynamic-uid/") + DECIMAL_STR_MAX(uid_t) + 1]; + char lock_path[STRLEN("/run/systemd/dynamic-uid/") + DECIMAL_STR_MAX(uid_t) + 1]; _cleanup_free_ char *user = NULL; uid_t check_uid; int r; |