return -ECONNREFUSED;
}
- if (!arg_quiet && d.result) {
+ if (!d.result)
+ goto free_name;
+
+ if (!arg_quiet) {
if (streq(d.result, "timeout"))
log_error("Job for %s timed out.", strna(d.name));
else if (streq(d.result, "canceled"))
free(d.result);
d.result = NULL;
+ free_name:
free(d.name);
d.name = NULL;
}
- /* This is slightly dirty, since we don't undo the filter registration. */
+ dbus_connection_remove_filter(bus, wait_filter, &d);
return r;
}
p = NULL;
}
- /* When stopping a unit warn if it can still be triggered by
- * another active unit (socket, path, timer) */
- if (!arg_quiet && streq(method, "StopUnit"))
- check_triggering_units(bus, name);
-
return 0;
}
ret = r;
goto finish;
}
+
+ /* When stopping units, warn if they can still be triggered by
+ * another active unit (socket, path, timer) */
+ if (!arg_quiet && streq(method, "StopUnit")) {
+ if (one_name)
+ check_triggering_units(bus, one_name);
+ else
+ STRV_FOREACH(name, args+1)
+ check_triggering_units(bus, *name);
+ }
}
finish:
on_tty() * OUTPUT_COLOR;
printf("\n");
- show_journal_by_unit(i->id, arg_output, 0,
+ show_journal_by_unit(stdout,
+ i->id,
+ arg_output,
+ 0,
i->inactive_exit_timestamp_monotonic,
- arg_lines, flags);
+ arg_lines,
+ flags);
}
if (i->need_daemon_reload)