summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-23 19:21:25 +0100
committerGitHub <noreply@github.com>2018-03-23 19:21:25 +0100
commit1b25e0351a968581fadacab616e7922941aa4466 (patch)
treeec869ccc28c6c87368a3a4eda6944ab526e7022c /src
parent303d6b4ca6ebadca2f6faf63a76743e22efba242 (diff)
parent849b610489a125799a7395f3d8223e63e5c21b40 (diff)
downloadsystemd-1b25e0351a968581fadacab616e7922941aa4466.tar.gz
Merge pull request #8559 from poettering/integration-test-fixes
make integration tests pass again
Diffstat (limited to 'src')
-rw-r--r--src/basic/stat-util.c3
-rw-r--r--src/tmpfiles/tmpfiles.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
index 3689f6e983..67705947aa 100644
--- a/src/basic/stat-util.c
+++ b/src/basic/stat-util.c
@@ -254,7 +254,8 @@ int fd_is_network_ns(int fd) {
if (r <= 0)
return r;
- if (ioctl(fd, NS_GET_NSTYPE) < 0)
+ r = ioctl(fd, NS_GET_NSTYPE);
+ if (r < 0)
return -errno;
return r == CLONE_NEWNET;
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 1794290ebe..b56b7ac963 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -821,7 +821,7 @@ static int fd_set_perms(Item *i, int fd, const struct stat *st) {
if (m == (st->st_mode & 07777))
log_debug("\"%s\" has correct mode %o already.", path, st->st_mode);
else {
- char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
+ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
log_debug("Changing \"%s\" to mode %o.", path, m);
@@ -920,7 +920,7 @@ static int parse_xattrs_from_arg(Item *i) {
}
static int fd_set_xattrs(Item *i, int fd, const struct stat *st) {
- char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
+ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
_cleanup_free_ char *path = NULL;
char **name, **value;
int r;
@@ -1024,7 +1024,7 @@ static int path_set_acl(const char *path, const char *pretty, acl_type_t type, a
static int fd_set_acls(Item *item, int fd, const struct stat *st) {
int r = 0;
#if HAVE_ACL
- char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
+ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
_cleanup_free_ char *path = NULL;
assert(item);
@@ -1186,7 +1186,7 @@ static int parse_attribute_from_arg(Item *item) {
}
static int fd_set_attribute(Item *item, int fd, const struct stat *st) {
- char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
+ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
_cleanup_close_ int procfs_fd = -1;
_cleanup_free_ char *path = NULL;
unsigned f;