git://scientific.zcu.cz
/
jra1mw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b6d95b
)
Forgotten tzset() yet when restoring timezone.
author
František Dvořák
<valtri@civ.zcu.cz>
Thu, 1 Apr 2010 10:40:43 +0000
(10:40 +0000)
committer
František Dvořák
<valtri@civ.zcu.cz>
Thu, 1 Apr 2010 10:40:43 +0000
(10:40 +0000)
org.glite.lbjp-common.db/src/db.c
patch
|
blob
|
blame
|
history
diff --git
a/org.glite.lbjp-common.db/src/db.c
b/org.glite.lbjp-common.db/src/db.c
index
c574c7b
..
69705dd
100644
(file)
--- a/
org.glite.lbjp-common.db/src/db.c
+++ b/
org.glite.lbjp-common.db/src/db.c
@@
-151,6
+151,7
@@
time_t glite_lbu_StrToTime(const char *str) {
if (tz) setenv("TZ", tz, 1);
else unsetenv("TZ");
+ tzset();
return t;
}
@@
-164,6
+165,8
@@
double glite_lbu_StrToTimestamp(const char *str) {
memset(&tm,0,sizeof(tm));
tz = getenv("TZ");
setenv("TZ", "UTC", 1);
+ tzset();
+
sscanf(str,"%4d-%02d-%02d %02d:%02d:%lf",
&tm.tm_year,&tm.tm_mon,&tm.tm_mday,
&tm.tm_hour,&tm.tm_min,&sec);
@@
-175,6
+178,7
@@
double glite_lbu_StrToTimestamp(const char *str) {
if (tz) setenv("TZ", tz, 1);
else unsetenv("TZ");
+ tzset();
return t;
}