X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Ftimedate%2Ftimedatectl.c;h=54b39a1806f4775dff15d6835f003d3a7e5ba84f;hp=9926a8a8803b83591a42ef5000156dfd31164a03;hb=46e65dcc3a522b5e992e165b5e61d14254026859;hpb=84f6181c2ac99a0514ca5e0c8fc8c8e284caf789 diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 9926a8a88..54b39a180 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -58,6 +58,9 @@ static void polkit_agent_open_if_enabled(void) { if (!arg_ask_password) return; + if (arg_transport != BUS_TRANSPORT_LOCAL) + return; + polkit_agent_open(); } @@ -445,7 +448,7 @@ static int parse_argv(int argc, char *argv[]) { { "machine", required_argument, NULL, 'M' }, { "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD }, { "adjust-system-clock", no_argument, NULL, ARG_ADJUST_SYSTEM_CLOCK }, - { NULL, 0, NULL, 0 } + {} }; int c; @@ -458,8 +461,7 @@ static int parse_argv(int argc, char *argv[]) { switch (c) { case 'h': - help(); - return 0; + return help(); case ARG_VERSION: puts(PACKAGE_STRING); @@ -492,8 +494,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - log_error("Unknown option code %c", c); - return -EINVAL; + assert_not_reached("Unhandled option"); } }