diff options
Diffstat (limited to 'util-linux/hwclock.c')
-rw-r--r-- | util-linux/hwclock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c index 25db7cdad..723b09589 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c | |||
@@ -79,7 +79,7 @@ static time_t read_rtc(const char **pp_rtcname, struct timeval *sys_tv, int utc) | |||
79 | int before = tm_time.tm_sec; | 79 | int before = tm_time.tm_sec; |
80 | while (1) { | 80 | while (1) { |
81 | rtc_read_tm(&tm_time, fd); | 81 | rtc_read_tm(&tm_time, fd); |
82 | gettimeofday(sys_tv, NULL); | 82 | xgettimeofday(sys_tv); |
83 | if (before != (int)tm_time.tm_sec) | 83 | if (before != (int)tm_time.tm_sec) |
84 | break; | 84 | break; |
85 | } | 85 | } |
@@ -205,7 +205,7 @@ static void from_sys_clock(const char **pp_rtcname, int utc) | |||
205 | int rtc; | 205 | int rtc; |
206 | 206 | ||
207 | rtc = rtc_xopen(pp_rtcname, O_WRONLY); | 207 | rtc = rtc_xopen(pp_rtcname, O_WRONLY); |
208 | gettimeofday(&tv, NULL); | 208 | xgettimeofday(&tv); |
209 | /* Prepare tm_time */ | 209 | /* Prepare tm_time */ |
210 | if (sizeof(time_t) == sizeof(tv.tv_sec)) { | 210 | if (sizeof(time_t) == sizeof(tv.tv_sec)) { |
211 | if (utc) | 211 | if (utc) |
@@ -253,7 +253,7 @@ static void from_sys_clock(const char **pp_rtcname, int utc) | |||
253 | unsigned rem_usec; | 253 | unsigned rem_usec; |
254 | time_t t; | 254 | time_t t; |
255 | 255 | ||
256 | gettimeofday(&tv, NULL); | 256 | xgettimeofday(&tv); |
257 | 257 | ||
258 | t = tv.tv_sec; | 258 | t = tv.tv_sec; |
259 | rem_usec = 1000000 - tv.tv_usec; | 259 | rem_usec = 1000000 - tv.tv_usec; |
@@ -274,7 +274,7 @@ static void from_sys_clock(const char **pp_rtcname, int utc) | |||
274 | } | 274 | } |
275 | 275 | ||
276 | /* gmtime/localtime took some time, re-get cur time */ | 276 | /* gmtime/localtime took some time, re-get cur time */ |
277 | gettimeofday(&tv, NULL); | 277 | xgettimeofday(&tv); |
278 | 278 | ||
279 | if (tv.tv_sec < t /* we are still in old second */ | 279 | if (tv.tv_sec < t /* we are still in old second */ |
280 | || (tv.tv_sec == t && tv.tv_usec < adj) /* not too far into next second */ | 280 | || (tv.tv_sec == t && tv.tv_usec < adj) /* not too far into next second */ |