summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/osdep.c30
-rw-r--r--mbbsd/register.c3
-rw-r--r--mbbsd/user.c3
3 files changed, 30 insertions, 6 deletions
diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c
index 1bca7208..598cc5fd 100644
--- a/mbbsd/osdep.c
+++ b/mbbsd/osdep.c
@@ -76,6 +76,36 @@ strlcat(dst, src, siz)
#endif
+#ifdef NEED_TIMEGM
+
+#include <time.h>
+#include <stdlib.h>
+
+time_t timegm (struct tm *tm)
+{
+ time_t ret;
+ char *tz;
+
+ tz = getenv("TZ");
+ putenv("TZ=");
+ tzset();
+ ret = mktime(tm);
+
+ if (tz){
+ char *buff = malloc( strlen(tz) + 10);
+ sprintf( buff, "TZ=%s", tz);
+ putenv(buff);
+ free(buff);
+ }
+ else
+ unsetenv("TZ");
+ tzset();
+
+ return ret;
+}
+
+#endif
+
#ifdef NEED_STRLCPY
/* ------------------------------------------------------------------------ */
diff --git a/mbbsd/register.c b/mbbsd/register.c
index a578f16a..e33a5098 100644
--- a/mbbsd/register.c
+++ b/mbbsd/register.c
@@ -1,7 +1,4 @@
/* $Id$ */
-#define _XOPEN_SOURCE
-#define _ISOC99_SOURCE
-
#include "bbs.h"
char *
diff --git a/mbbsd/user.c b/mbbsd/user.c
index eb93217e..819595a8 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -1,7 +1,4 @@
/* $Id$ */
-#define _XOPEN_SOURCE
-#define _ISOC99_SOURCE
-
#include "bbs.h"
static char * const sex[8] = {