| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
|
| 3 |
#include "sd-bus.h" |
| 4 |
|
| 5 |
#include "alloc-util.h" |
| 6 |
#include "analyze.h" |
| 7 |
#include "analyze-time.h" |
| 8 |
#include "analyze-time-data.h" |
| 9 |
#include "bus-util.h" |
| 10 |
#include "runtime-scope.h" |
| 11 |
|
| 12 |
int verb_time(int argc, char *argv[], uintptr_t _data, void *userdata) { |
| 13 |
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; |
| 14 |
_cleanup_free_ char *buf = NULL; |
| 15 |
int r; |
| 16 |
|
| 17 |
r = acquire_bus(&bus, NULL); |
| 18 |
if (r < 0) |
| 19 |
return bus_log_connect_error(r, arg_transport, arg_runtime_scope); |
| 20 |
|
| 21 |
r = pretty_boot_time(bus, &buf); |
| 22 |
if (r < 0) |
| 23 |
return r; |
| 24 |
|
| 25 |
puts(buf); |
| 26 |
return EXIT_SUCCESS; |
| 27 |
} |