if (arg_no_pager)
return;
- pager_open();
+ pager_open(false);
}
static void ask_password_agent_open_if_enabled(void) {
}
static int get_cgroup_attr(DBusConnection *bus, char **args) {
- _cleanup_dbus_message_unref_ DBusMessage *m = NULL, *reply = NULL;
+ _cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
_cleanup_free_ char *n = NULL;
char **argument;
int r;
if (i->id && arg_transport != TRANSPORT_SSH) {
printf("\n");
- if(arg_scope == UNIT_FILE_SYSTEM)
- show_journal_by_unit(stdout,
- i->id,
- arg_output,
- 0,
- i->inactive_exit_timestamp_monotonic,
- arg_lines,
- flags);
- else
- show_journal_by_user_unit(stdout,
- i->id,
- arg_output,
- 0,
- i->inactive_exit_timestamp_monotonic,
- arg_lines,
- getuid(),
- flags);
+ show_journal_by_unit(stdout,
+ i->id,
+ arg_output,
+ 0,
+ i->inactive_exit_timestamp_monotonic,
+ arg_lines,
+ getuid(),
+ flags,
+ arg_scope == UNIT_FILE_SYSTEM);
}
if (i->need_daemon_reload)
}
static int talk_initctl(void) {
- struct init_request request;
- int r, fd;
+ struct init_request request = {0};
+ int r;
+ int _cleanup_close_ fd = -1;
char rl;
- if (!(rl = action_to_runlevel()))
+ rl = action_to_runlevel();
+ if (!rl)
return 0;
- zero(request);
request.magic = INIT_MAGIC;
request.sleeptime = 0;
request.cmd = INIT_CMD_RUNLVL;
request.runlevel = rl;
- if ((fd = open(INIT_FIFO, O_WRONLY|O_NDELAY|O_CLOEXEC|O_NOCTTY)) < 0) {
-
+ fd = open(INIT_FIFO, O_WRONLY|O_NDELAY|O_CLOEXEC|O_NOCTTY);
+ if (fd < 0) {
if (errno == ENOENT)
return 0;
errno = 0;
r = loop_write(fd, &request, sizeof(request), false) != sizeof(request);
- close_nointr_nofail(fd);
-
- if (r < 0) {
+ if (r) {
log_error("Failed to write to "INIT_FIFO": %m");
return errno ? -errno : -EIO;
}