summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-22 15:31:50 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-22 15:31:50 +0100
commit201be4265ff8ce4e66f8a071ca588b2ed8869f61 (patch)
tree1a823f2a2c9d7e897f43039ce22a8c8dfb5ee729 /src/tmpfiles
parenttmpfiles: in dir_cleanup() take benefit that log_error_errno() returns the er... (diff)
downloadsystemd-201be4265ff8ce4e66f8a071ca588b2ed8869f61.tar.xz
systemd-201be4265ff8ce4e66f8a071ca588b2ed8869f61.zip
tmpfiles: avoid using wrong type for strlen() result
The result of strlen is size_t, hence let's not store it in an "int" just to pass it on as as size_t right-away. In fact let's not store it at all…
Diffstat (limited to 'src/tmpfiles')
-rw-r--r--src/tmpfiles/tmpfiles.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 128abb835e..f96f400aa0 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -877,11 +877,8 @@ static int path_set_xattrs(Item *i, const char *path) {
assert(path);
STRV_FOREACH_PAIR(name, value, i->xattrs) {
- int n;
-
- n = strlen(*value);
log_debug("Setting extended attribute '%s=%s' on %s.", *name, *value, path);
- if (lsetxattr(path, *name, *value, n, 0) < 0)
+ if (lsetxattr(path, *name, *value, strlen(*value), 0) < 0)
return log_error_errno(errno, "Setting extended attribute %s=%s on %s failed: %m",
*name, *value, path);
}