summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-24 12:33:07 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:55:52 +0200
commiteca830bee94e2cd24add44a5aa5c1836f54da27a (patch)
treed36aabf53e494572e71426f9f86662a0cf353f19
parent172d7abfea003d84d0e697a510a222f32b40f4c0 (diff)
systemctl: conditionalize /dev/initctl fallback on HAVE_SYSV_COMPAT
-rw-r--r--src/systemctl/systemctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 804f485403..c85c5e011b 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -7118,7 +7118,7 @@ _pure_ static int action_to_runlevel(void) {
}
static int talk_initctl(void) {
-
+#ifdef HAVE_SYSV_COMPAT
struct init_request request = {
.magic = INIT_MAGIC,
.sleeptime = 0,
@@ -7140,8 +7140,7 @@ static int talk_initctl(void) {
if (errno == ENOENT)
return 0;
- log_error_errno(errno, "Failed to open "INIT_FIFO": %m");
- return -errno;
+ return log_error_errno(errno, "Failed to open "INIT_FIFO": %m");
}
r = loop_write(fd, &request, sizeof(request), false);
@@ -7149,6 +7148,9 @@ static int talk_initctl(void) {
return log_error_errno(r, "Failed to write to "INIT_FIFO": %m");
return 1;
+#else
+ return 0;
+#endif
}
static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {