chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74b2a31
)
time-util: mktime_or_timegm are changing the struct tm
author
Marcel Hollerbach
<marcel-hollerbach@t-online.de>
Wed, 20 Sep 2017 17:26:13 +0000
(19:26 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 20 Sep 2017 17:26:13 +0000
(19:26 +0200)
after that wm_day etc. seems to be changed. Moving the check infront of
the mktime_or_timegm fixes that.
src/basic/time-util.c
patch
|
blob
|
history
diff --git
a/src/basic/time-util.c
b/src/basic/time-util.c
index 3f3ec68901e275358cd55a953a36998c2dd5295e..f984f46b5bb81777e1e48e176701a4f69b6bd8d6 100644
(file)
--- a/
src/basic/time-util.c
+++ b/
src/basic/time-util.c
@@
-861,11
+861,11
@@
parse_usec:
}
from_tm:
- x = mktime_or_timegm(&tm, utc);
- if (x < 0)
+ if (weekday >= 0 && tm.tm_wday != weekday)
return -EINVAL;
- if (weekday >= 0 && tm.tm_wday != weekday)
+ x = mktime_or_timegm(&tm, utc);
+ if (x < 0)
return -EINVAL;
ret = (usec_t) x * USEC_PER_SEC + x_usec;