summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-02 20:12:36 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-04 20:36:09 -0400
commit79f1c8f6194dc0a2ab1a1f718c1feef16e0d262e (patch)
treea3e80a0c069d4816786d848d5dcf32d01d0ef3c0 /src
parenta75e27eb7006bc67345a3f28bf28a111a7540830 (diff)
build-sys: use a single ENABLE_LOGIND conditional
We used ENABLE_LOGIND for the automake conditional, and HAVE_LOGIND for the ifdef. That wasn't wrong, but it certainly was confusing. Also, move the ifdeffery to avoid warning about unused static function logind_set_wall_message() when logind is disabled.
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index cb9ca9ae1e..64945121f7 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3191,8 +3191,8 @@ static int start_unit(int argc, char *argv[], void *userdata) {
return r;
}
+#ifdef ENABLE_LOGIND
static int logind_set_wall_message(void) {
-#ifdef HAVE_LOGIND
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus;
_cleanup_free_ char *m = NULL;
@@ -3220,15 +3220,14 @@ static int logind_set_wall_message(void) {
if (r < 0)
return log_warning_errno(r, "Failed to set wall message, ignoring: %s", bus_error_message(&error, r));
-
-#endif
return 0;
}
+#endif
/* Ask systemd-logind, which might grant access to unprivileged users
* through PolicyKit */
static int logind_reboot(enum action a) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
const char *method, *description;
sd_bus *bus;
@@ -3291,7 +3290,7 @@ static int logind_reboot(enum action a) {
}
static int logind_check_inhibitors(enum action a) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_strv_free_ char **sessions = NULL;
const char *what, *who, *why, *mode;
@@ -3410,7 +3409,7 @@ static int logind_check_inhibitors(enum action a) {
}
static int logind_prepare_firmware_setup(void) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus;
int r;
@@ -8281,7 +8280,7 @@ static int halt_now(enum action a) {
static int logind_schedule_shutdown(void) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
char date[FORMAT_TIMESTAMP_MAX];
const char *action;
@@ -8409,7 +8408,7 @@ static int runlevel_main(void) {
}
static int logind_cancel_shutdown(void) {
-#ifdef HAVE_LOGIND
+#ifdef ENABLE_LOGIND
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus *bus;
int r;