chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix hwclock_apply_localtime_delta() to properly handle negative TZ offset
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index a0fbdc517e7167a7f85cfe4ecccdfb9afa22175f..3187ec37687a6c9709127468da4787e4a2cd4a4f 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-4905,7
+4905,7
@@
int hwclock_is_localtime(void) {
return local;
}
return local;
}
-int hwclock_apply_localtime_delta(
void
) {
+int hwclock_apply_localtime_delta(
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;
@@
-4926,8
+4926,9
@@
int hwclock_apply_localtime_delta(void) {
*/
if (settimeofday(tv_null, &tz) < 0)
return -errno;
*/
if (settimeofday(tv_null, &tz) < 0)
return -errno;
-
- return minuteswest;
+ if (min)
+ *min = minuteswest;
+ return 0;
}
int hwclock_reset_localtime_delta(void) {
}
int hwclock_reset_localtime_delta(void) {