]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timedate: actually reset system time with new timezone
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Jan 2021 12:00:27 +0000 (21:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Jan 2021 15:59:33 +0000 (00:59 +0900)
Fix a bug introduced by 56b0ef2fc283425df6ae6f1dc198e0c408f70471.

Closes CID#1436943.

src/timedate/timedated.c

index 8bfcfd5cdc3a114d9e1c67167457452c1dcd1c32..8149facb346396fff9f18b08860369722c980289 100644 (file)
@@ -771,7 +771,7 @@ static int method_set_local_rtc(sd_bus_message *m, void *userdata, sd_bus_error
                         log_debug_errno(r, "Failed to get hardware clock, ignoring: %m");
                 else {
                         /* And set the system clock with this */
-                        mktime_or_timegm(&tm, !c->local_rtc);
+                        ts.tv_sec = mktime_or_timegm(&tm, !c->local_rtc);
 
                         if (clock_settime(CLOCK_REALTIME, &ts) < 0)
                                 log_debug_errno(errno, "Failed to update system clock, ignoring: %m");