X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsystemctl%2Fsystemctl.c;h=2362f43a2fcfb08c9cbef1bc90bbd69a1d036636;hb=d5d217eae1b3ba978c4ddd6a2ef2de4621329662;hp=0e833ab538ba1e91f4891100ae03dd4a9fe76843;hpb=1823b86ebf955b737fb87372b211fa45ba799a48;p=elogind.git diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 0e833ab53..2362f43a2 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -750,7 +750,6 @@ static int get_next_elapse( dual_timestamp *next) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; dual_timestamp t; int r; @@ -1445,11 +1444,12 @@ static void output_jobs_list(const struct job_info* jobs, unsigned n) { shorten = true; } - printf("%*s %-*s %-*s %-*s\n", - id_len, "JOB", - unit_len, "UNIT", - type_len, "TYPE", - state_len, "STATE"); + if (!arg_no_legend) + printf("%*s %-*s %-*s %-*s\n", + id_len, "JOB", + unit_len, "UNIT", + type_len, "TYPE", + state_len, "STATE"); for (j = jobs; j < jobs + n; j++) { _cleanup_free_ char *e = NULL; @@ -1468,10 +1468,12 @@ static void output_jobs_list(const struct job_info* jobs, unsigned n) { on, state_len, j->state, off); } - on = ansi_highlight(); - off = ansi_highlight_off(); + if (!arg_no_legend) { + on = ansi_highlight(); + off = ansi_highlight_off(); - printf("\n%s%u jobs listed%s.\n", on, n, off); + printf("\n%s%u jobs listed%s.\n", on, n, off); + } } static int list_jobs(sd_bus *bus, char **args) { @@ -2124,7 +2126,6 @@ static int reboot_with_logind(sd_bus *bus, enum action a) { static int check_inhibitors(sd_bus *bus, enum action a) { #ifdef HAVE_LOGIND - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_strv_free_ char **sessions = NULL; const char *what, *who, *why, *mode; @@ -3539,7 +3540,6 @@ static int show_all( bool *new_line, bool *ellipsized) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_free_ UnitInfo *unit_infos = NULL; const UnitInfo *u; @@ -3845,7 +3845,7 @@ static int set_property(sd_bus *bus, char **args) { if (r < 0) return bus_log_create_error(r); - r = sd_bus_send_with_reply_and_block(bus, m, -1, &error, NULL); + r = sd_bus_call(bus, m, 0, &error, NULL); if (r < 0) { log_error("Failed to set unit properties on %s: %s", n, bus_error_message(&error, r)); return r; @@ -4132,7 +4132,7 @@ static int set_environment(sd_bus *bus, char **args) { if (r < 0) return bus_log_create_error(r); - r = sd_bus_send_with_reply_and_block(bus, m, -1, &error, NULL); + r = sd_bus_call(bus, m, 0, &error, NULL); if (r < 0) { log_error("Failed to set environment: %s", bus_error_message(&error, r)); return r; @@ -4443,7 +4443,7 @@ static int enable_unit(sd_bus *bus, char **args) { return bus_log_create_error(r); } - r = sd_bus_send_with_reply_and_block(bus, m, -0, &error, &reply); + r = sd_bus_call(bus, m, 0, &error, &reply); if (r < 0) { log_error("Failed to execute operation: %s", bus_error_message(&error, r)); return r;