summaryrefslogtreecommitdiffstats
path: root/src/nspawn
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-15 19:21:37 +0200
committerLennart Poettering <lennart@poettering.net>2018-10-15 19:40:51 +0200
commit6d5e65f6454212cd400d0ebda34978a9f20cc26a (patch)
tree844cd4d517956481a0963598edf586ae454524a0 /src/nspawn
parentsocket-util: tighten socket_address_verify() checks a bit (diff)
downloadsystemd-6d5e65f6454212cd400d0ebda34978a9f20cc26a.tar.xz
systemd-6d5e65f6454212cd400d0ebda34978a9f20cc26a.zip
tree-wide: add a single version of "static const int one = 1"
All over the place we define local variables for the various sockopts that take a bool-like "int" value. Sometimes they are const, sometimes static, sometimes both, sometimes neither. Let's clean this up, introduce a common const variable "const_int_one" (as well as one matching "const_int_zero") and use it everywhere, all acorss the codebase.
Diffstat (limited to 'src/nspawn')
-rw-r--r--src/nspawn/nspawn.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index d756d0aed0..49b8ba466a 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2812,7 +2812,6 @@ static int inner_child(
}
static int setup_sd_notify_child(void) {
- static const int one = 1;
int fd = -1;
union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
@@ -2839,7 +2838,7 @@ static int setup_sd_notify_child(void) {
return log_error_errno(r, "Failed to chown " NSPAWN_NOTIFY_SOCKET_PATH ": %m");
}
- r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
+ r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &const_int_one, sizeof(const_int_one));
if (r < 0) {
safe_close(fd);
return log_error_errno(errno, "SO_PASSCRED failed: %m");