#include "spawn-polkit-agent.h"
#include "install.h"
#include "logs-show.h"
-#include "path-util.h"
#include "socket-util.h"
#include "fileio.h"
#include "bus-util.h"
struct socket_info *s;
unsigned cs = 0;
size_t size = 0;
- int r, n;
+ int r = 0, n;
pager_open_if_enabled();
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;
struct timer_info *t;
const UnitInfo *u;
size_t size = 0;
- int n, r, c = 0;
+ int n, c = 0;
dual_timestamp nw;
+ int r = 0;
pager_open_if_enabled();
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;
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) {
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;
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;
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;
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;
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;