OpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD. Apart from that, mainly #ifdefs.
This commit is contained in:
committed by
Jon Trulson
parent
3718075b7c
commit
57463ec10e
@@ -45,7 +45,11 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/signal.h>
|
||||
#include <rpc/rpc.h>
|
||||
#if defined(CSRG_BASED)
|
||||
#define MAXINT INT_MAX
|
||||
#else
|
||||
#include <values.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <pwd.h>
|
||||
#ifdef SUNOS
|
||||
@@ -1406,12 +1410,21 @@ extern long *
|
||||
_DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq)
|
||||
{
|
||||
static long gmtoff;
|
||||
#if !defined(CSRG_BASED)
|
||||
extern long timezone;
|
||||
#else
|
||||
struct tm *t;
|
||||
#endif
|
||||
|
||||
if (debug)
|
||||
fprintf(stderr, "_DtCm_rtable_gmtoff_4_svc called\n");
|
||||
|
||||
#if defined(CSRG_BASED)
|
||||
t = localtime(time(NULL));
|
||||
gmtoff = t->tm_gmtoff;
|
||||
#else
|
||||
gmtoff = timezone;
|
||||
#endif
|
||||
return(&gmtoff);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user