repo.or.cz
/
dragonfly.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
if_iwm - Factor out firmware station handling into if_iwm_sta.c.
[dragonfly.git]
/
contrib
/
ldns
/
compat
/
timegm.c
blob
97e1e5443664b87747a63eacfc53277b38c0a050
1
#ifdef HAVE_CONFIG_H
2
#include <ldns/config.h>
3
#endif
4
5
#include <stdio.h>
6
7
#ifdef HAVE_STDLIB_H
8
#include <stdlib.h>
9
#endif
10
11
#include <time.h>
12
13
time_t
14
timegm
(
struct
tm
*
tm
) {
15
time_t
ret
;
16
char
*
tz
;
17
18
tz
=
getenv
(
"TZ"
);
19
putenv
((
char
*)
"TZ="
);
20
tzset
();
21
ret
=
mktime
(
tm
);
22
if
(
tz
) {
23
char
buf
[
256
];
24
snprintf
(
buf
,
sizeof
(
buf
),
"TZ=%s"
,
tz
);
25
putenv
(
tz
);
26
}
27
else
28
putenv
((
char
*)
"TZ"
);
29
tzset
();
30
return
ret
;
31
}