X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fhostname%2Fhostnamectl.c;h=5218b41b41595047a879fcb7e6324e4377248dc5;hb=27cc6f166bdebc0e698fb692993b801db2618866;hp=e48736920f126a6c4b048be48df03be97d38f482;hpb=41414fed519e2699b52c7e3eb0876a1feb3ef68c;p=elogind.git diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index e48736920..5218b41b4 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -21,12 +21,9 @@ #include #include -#include #include #include #include -#include -#include #include "sd-bus.h" @@ -35,12 +32,8 @@ #include "util.h" #include "spawn-polkit-agent.h" #include "build.h" -#include "clock-util.h" -#include "strv.h" #include "sd-id128.h" -#include "virt.h" #include "architecture.h" -#include "fileio.h" static bool arg_ask_password = true; static BusTransport arg_transport = BUS_TRANSPORT_LOCAL; @@ -405,7 +398,7 @@ static int parse_argv(int argc, char *argv[]) { break; case 'M': - arg_transport = BUS_TRANSPORT_CONTAINER; + arg_transport = BUS_TRANSPORT_MACHINE; arg_host = optarg; break; @@ -529,12 +522,12 @@ int main(int argc, char *argv[]) { r = bus_open_transport(arg_transport, arg_host, false, &bus); if (r < 0) { - log_error("Failed to create bus connection: %s", strerror(-r)); + log_error_errno(r, "Failed to create bus connection: %m"); goto finish; } r = hostnamectl_main(bus, argc, argv); finish: - return r < 0 ? EXIT_FAILURE : r; + return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; }