From: Pascal Stumpf Date: Fri, 10 Aug 2012 12:44:57 +0000 (+0200) Subject: OpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD... X-Git-Tag: 2.2.0b~83^2~32 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=57463ec10e2c2741fabbb91a6e699d1dd095314d;p=oweals%2Fcde.git OpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD. Apart from that, mainly #ifdefs. --- diff --git a/cde/programs/dtcm/dtcm/graphics.c b/cde/programs/dtcm/dtcm/graphics.c index cc692ef0..c8b4103e 100644 --- a/cde/programs/dtcm/dtcm/graphics.c +++ b/cde/programs/dtcm/dtcm/graphics.c @@ -54,7 +54,9 @@ static char sccsid[] = "@(#)graphics.c 1.23 94/11/29 Copyr 1994 Sun Microsystem #include #include #include +#if !defined(CSRG_BASED) #include +#endif #include /* MAXPATHLEN defined here */ #ifdef SVR4 #include /* SYS_NMLN */ diff --git a/cde/programs/dtcm/libDtCmP/getdate.y b/cde/programs/dtcm/libDtCmP/getdate.y index 35a1aa32..e3238220 100644 --- a/cde/programs/dtcm/libDtCmP/getdate.y +++ b/cde/programs/dtcm/libDtCmP/getdate.y @@ -65,7 +65,9 @@ static char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 1993 Sun Microsystems #define STANDARD 2 #define MAYBE 3 +#ifdef SVR4 extern long timezone; +#endif %} diff --git a/cde/programs/dtcm/libDtCmP/timeops.c b/cde/programs/dtcm/libDtCmP/timeops.c index f0cdbbd7..dcb722ba 100644 --- a/cde/programs/dtcm/libDtCmP/timeops.c +++ b/cde/programs/dtcm/libDtCmP/timeops.c @@ -1008,6 +1008,7 @@ init_time() _Xltimeparams localtime_buf; _Xgtimeparams gmtime_buf; +#ifdef SVR4 /* Fix for QAR 31607 */ tzset(); if (getenv("TZ") == NULL){ @@ -1017,6 +1018,7 @@ init_time() putenv(tzptr); tzset(); } +#endif t = now(); tm = *_XLocaltime(&t, localtime_buf); diff --git a/cde/programs/dtcm/server/delete.c b/cde/programs/dtcm/server/delete.c index 879d7eaf..46479d90 100644 --- a/cde/programs/dtcm/server/delete.c +++ b/cde/programs/dtcm/server/delete.c @@ -38,7 +38,9 @@ #include #include #include +#if !defined(CSRG_BASED) #include +#endif #ifdef SunOS #include #endif diff --git a/cde/programs/dtcm/server/insert.c b/cde/programs/dtcm/server/insert.c index 7c0852f4..35591083 100644 --- a/cde/programs/dtcm/server/insert.c +++ b/cde/programs/dtcm/server/insert.c @@ -38,7 +38,9 @@ #include #include #include +#if !defined(CSRG_BASED) #include +#endif #ifdef SunOS #include #endif diff --git a/cde/programs/dtcm/server/lookup.c b/cde/programs/dtcm/server/lookup.c index 5a5ac6a1..883aba64 100644 --- a/cde/programs/dtcm/server/lookup.c +++ b/cde/programs/dtcm/server/lookup.c @@ -38,7 +38,9 @@ #include #include #include +#if !defined(CSRG_BASED) #include +#endif #ifdef SunOS #include #endif diff --git a/cde/programs/dtcm/server/rtable4.c b/cde/programs/dtcm/server/rtable4.c index fb6aab00..061b63dc 100644 --- a/cde/programs/dtcm/server/rtable4.c +++ b/cde/programs/dtcm/server/rtable4.c @@ -45,7 +45,11 @@ #include #include #include +#if defined(CSRG_BASED) +#define MAXINT INT_MAX +#else #include +#endif #include #include #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); } diff --git a/cde/programs/dtcm/server/svcmain.c b/cde/programs/dtcm/server/svcmain.c index 62230ad5..d329f684 100644 --- a/cde/programs/dtcm/server/svcmain.c +++ b/cde/programs/dtcm/server/svcmain.c @@ -702,7 +702,8 @@ main(int argc, char **argv) if (udp_transp == (SVCXPRT *)-1) { udp_transp = svcudp_create(standalone ? RPC_ANYSOCK : 0 -#if defined(_AIX) || defined(hpV4) || defined(__osf__) || defined(linux) +#if defined(_AIX) || defined(hpV4) || defined(__osf__) || defined(linux) || \ + defined(CSRG_BASED) ); #else ,0,0); diff --git a/cde/programs/dtcm/server/update.c b/cde/programs/dtcm/server/update.c index 5861b928..ed20fca2 100644 --- a/cde/programs/dtcm/server/update.c +++ b/cde/programs/dtcm/server/update.c @@ -38,7 +38,9 @@ #include #include #include +#if !defined(CSRG_BASED) #include +#endif #ifdef SunOS #include #endif diff --git a/cde/programs/dtcm/server/v4ops.c b/cde/programs/dtcm/server/v4ops.c index af97c4b2..d4eceba9 100644 --- a/cde/programs/dtcm/server/v4ops.c +++ b/cde/programs/dtcm/server/v4ops.c @@ -36,7 +36,12 @@ #include #include #include +#if defined(CSRG_BASED) +#include +#define MAXINT INT_MAX +#else #include +#endif #ifdef SunOS #include #endif