chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: reuse more code
[elogind.git]
/
src
/
shared
/
hwclock.c
diff --git
a/src/shared/hwclock.c
b/src/shared/hwclock.c
index 0e8fa45971325704640a701af5666d8e50c76684..488c30e93f6c8ce04dfb2da451b4c60022b0c9c4 100644
(file)
--- a/
src/shared/hwclock.c
+++ b/
src/shared/hwclock.c
@@
-41,6
+41,7
@@
#include "log.h"
#include "strv.h"
#include "hwclock.h"
#include "log.h"
#include "strv.h"
#include "hwclock.h"
+#include "fileio.h"
static int rtc_open(int flags) {
int fd;
static int rtc_open(int flags) {
int fd;
@@
-199,14
+200,14
@@
int hwclock_set_timezone(int *min) {
const struct timeval *tv_null = NULL;
struct timespec ts;
struct tm *tm;
const struct timeval *tv_null = NULL;
struct timespec ts;
struct tm *tm;
- int minutes
west
;
+ int minutes
delta
;
struct timezone tz;
assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0);
assert_se(tm = localtime(&ts.tv_sec));
struct timezone tz;
assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0);
assert_se(tm = localtime(&ts.tv_sec));
- minutes
west
= tm->tm_gmtoff / 60;
+ minutes
delta
= tm->tm_gmtoff / 60;
- tz.tz_minuteswest = -minutes
west
;
+ tz.tz_minuteswest = -minutes
delta
;
tz.tz_dsttime = 0; /* DST_NONE*/
/*
tz.tz_dsttime = 0; /* DST_NONE*/
/*
@@
-217,7
+218,7
@@
int hwclock_set_timezone(int *min) {
if (settimeofday(tv_null, &tz) < 0)
return -errno;
if (min)
if (settimeofday(tv_null, &tz) < 0)
return -errno;
if (min)
- *min = minutes
west
;
+ *min = minutes
delta
;
return 0;
}
return 0;
}