mirror of
https://github.com/systemd/systemd.git
synced 2024-11-08 11:27:32 +03:00
systemctl: conditionalize /dev/initctl fallback on HAVE_SYSV_COMPAT
This commit is contained in:
parent
172d7abfea
commit
eca830bee9
@ -7118,7 +7118,7 @@ _pure_ static int action_to_runlevel(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int talk_initctl(void) {
|
static int talk_initctl(void) {
|
||||||
|
#ifdef HAVE_SYSV_COMPAT
|
||||||
struct init_request request = {
|
struct init_request request = {
|
||||||
.magic = INIT_MAGIC,
|
.magic = INIT_MAGIC,
|
||||||
.sleeptime = 0,
|
.sleeptime = 0,
|
||||||
@ -7140,8 +7140,7 @@ static int talk_initctl(void) {
|
|||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log_error_errno(errno, "Failed to open "INIT_FIFO": %m");
|
return log_error_errno(errno, "Failed to open "INIT_FIFO": %m");
|
||||||
return -errno;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = loop_write(fd, &request, sizeof(request), false);
|
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 log_error_errno(r, "Failed to write to "INIT_FIFO": %m");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
|
static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user