Change ether_demux() interface to accept mbuf containing ether header.
[dragonfly.git] / libexec / bootpd / tzone.c
blob0fbe494513246fd75d4cc2da0db0e1a3ff4f171d
1 /*
2 * tzone.c - get the timezone
4 * This is shared by bootpd and bootpef
6 * $FreeBSD: src/libexec/bootpd/tzone.c,v 1.1.1.1.14.1 2000/11/11 00:10:41 dirk Exp $
7 * $DragonFly: src/libexec/bootpd/tzone.c,v 1.2 2003/06/17 04:27:07 dillon Exp $
8 */
10 #ifdef SVR4
11 /* XXX - Is this really SunOS specific? -gwr */
12 /* This is in <time.h> but only visible if (__STDC__ == 1). */
13 extern long timezone;
14 #else /* SVR4 */
15 /* BSD or SunOS */
16 # include <time.h>
17 # include <syslog.h>
18 #endif /* SVR4 */
20 #include "bptypes.h"
21 #include "report.h"
22 #include "tzone.h"
24 /* This is what other modules use. */
25 int32 secondswest;
28 * Get our timezone offset so we can give it to clients if the
29 * configuration file doesn't specify one.
31 void
32 tzone_init()
34 #ifdef SVR4
35 /* XXX - Is this really SunOS specific? -gwr */
36 secondswest = timezone;
37 #else /* SVR4 */
38 struct tm *tm;
39 time_t now;
41 (void)time(&now);
42 if ((tm = localtime(&now)) == NULL) {
43 secondswest = 0; /* Assume GMT for lack of anything better */
44 report(LOG_ERR, "localtime() failed");
45 } else {
46 secondswest = -tm->tm_gmtoff;
48 #endif /* SVR4 */