chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shared: add is_efiboot()
[elogind.git]
/
src
/
shared
/
hwclock.c
diff --git
a/src/shared/hwclock.c
b/src/shared/hwclock.c
index b93855d95704388d4c0a2568b2c679d82fe507a5..f9adf0369ea71cc38f23315b43b57d8b66a2dc08 100644
(file)
--- a/
src/shared/hwclock.c
+++ b/
src/shared/hwclock.c
@@
-94,6
+94,11
@@
static int rtc_open(int flags) {
continue;
p = strappend("/dev/", de->d_name);
continue;
p = strappend("/dev/", de->d_name);
+ if (!p) {
+ closedir(d);
+ return -ENOMEM;
+ }
+
fd = open(p, flags);
free(p);
fd = open(p, flags);
free(p);
@@
-194,14
+199,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*/
/*
@@
-212,7
+217,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;
}