summaryrefslogtreecommitdiff
path: root/src/import
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/import
parent8e8132c6b849a0aa34dbe8d97027beb50f71f1e3 (diff)
downloadsystemd-6d5e65f6454212cd400d0ebda34978a9f20cc26a.tar.gz
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/import')
-rw-r--r--src/import/importd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/import/importd.c b/src/import/importd.c
index c42b3914aa..7dd00b7545 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -584,7 +584,6 @@ static int manager_new(Manager **ret) {
.un.sun_family = AF_UNIX,
.un.sun_path = "/run/systemd/import/notify",
};
- static const int one = 1;
int r;
assert(ret);
@@ -613,7 +612,7 @@ static int manager_new(Manager **ret) {
if (bind(m->notify_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0)
return -errno;
- if (setsockopt(m->notify_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) < 0)
+ if (setsockopt(m->notify_fd, SOL_SOCKET, SO_PASSCRED, &const_int_one, sizeof(const_int_one)) < 0)
return -errno;
r = sd_event_add_io(m->event, &m->notify_event_source, m->notify_fd, EPOLLIN, manager_on_notify, m);