From 535e458a1b28ecdf69dddcace060807e462980fd Mon Sep 17 00:00:00 2001 From: victor Date: Sun, 12 Sep 2004 03:31:16 +0000 Subject: Solaris compatible git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2193 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/osdep.c | 30 ++++++++++++++++++++++++++++++ mbbsd/register.c | 3 --- mbbsd/user.c | 3 --- 3 files changed, 30 insertions(+), 6 deletions(-) (limited to 'mbbsd') 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 +#include + +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] = { -- cgit v1.2.3