chiark / gitweb /
path_check_timestamp: only keep the most recent timestamp
[elogind.git] / src / timedate / timedatectl.c
index e8bc4529f365620d59cf7c6625a88ddeed4a389b..80afc57131b68c0b295dffcd2767306654bb8df5 100644 (file)
@@ -44,7 +44,8 @@ static enum transport {
         TRANSPORT_POLKIT
 } arg_transport = TRANSPORT_NORMAL;
 static bool arg_ask_password = true;
-static const char *arg_host = NULL;
+static char *arg_host = NULL;
+static char *arg_user = NULL;
 
 static void pager_open_if_enabled(void) {
 
@@ -71,18 +72,6 @@ typedef struct StatusInfo {
         bool can_ntp;
 } StatusInfo;
 
-static bool ntp_synced(void) {
-        struct timex txc = {};
-
-        if (adjtimex(&txc) < 0)
-                return false;
-
-        if (txc.status & STA_UNSYNC)
-                return false;
-
-        return true;
-}
-
 static const char *jump_str(int delta_minutes, char *s, size_t size) {
         if (delta_minutes == 60)
                 return "one hour forward";
@@ -197,7 +186,7 @@ static void print_status_info(StatusInfo *i) {
 
         if (i->local_rtc)
                 fputs("\n" ANSI_HIGHLIGHT_ON
-                      "Warning: The RTC is configured to maintain time in the local time zone. This\n"
+                      "Warning: The RTC is configured to maintain time in the local timezone. This\n"
                       "         mode is not fully supported and will create various problems with time\n"
                       "         zone changes and daylight saving adjustments. If at all possible use\n"
                       "         RTC in UTC, by calling 'timedatectl set-local-rtc 0'" ANSI_HIGHLIGHT_OFF ".\n", stdout);
@@ -560,7 +549,7 @@ static int parse_argv(int argc, char *argv[]) {
 
                 case 'H':
                         arg_transport = TRANSPORT_SSH;
-                        arg_host = optarg;
+                        parse_user_at_host(optarg, &arg_user, &arg_host);
                         break;
 
                 case ARG_NO_ASK_PASSWORD: