OpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD...
authorPascal Stumpf <Pascal.Stumpf@cubes.de>
Fri, 10 Aug 2012 12:44:57 +0000 (14:44 +0200)
committerJon Trulson <jon@radscan.com>
Fri, 10 Aug 2012 20:11:54 +0000 (14:11 -0600)
cde/programs/dtcm/dtcm/graphics.c
cde/programs/dtcm/libDtCmP/getdate.y
cde/programs/dtcm/libDtCmP/timeops.c
cde/programs/dtcm/server/delete.c
cde/programs/dtcm/server/insert.c
cde/programs/dtcm/server/lookup.c
cde/programs/dtcm/server/rtable4.c
cde/programs/dtcm/server/svcmain.c
cde/programs/dtcm/server/update.c
cde/programs/dtcm/server/v4ops.c

index cc692ef0a9fe3447965f44996ebf27d3291193ac..c8b4103e4f409c233db716d630b68559669c515e 100644 (file)
@@ -54,7 +54,9 @@ static  char sccsid[] = "@(#)graphics.c 1.23 94/11/29 Copyr 1994 Sun Microsystem
 #include <EUSCompat.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#if !defined(CSRG_BASED)
 #include <sys/sysmacros.h>
+#endif
 #include <sys/param.h> /* MAXPATHLEN defined here */
 #ifdef SVR4
 #include <sys/utsname.h> /* SYS_NMLN */
index 35a1aa32cba9d66d33b44473d5b597fb3177395e..e3238220297fe9660c1d4a46e16996565640c5f4 100644 (file)
@@ -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
 
 %}
 
index f0cdbbd7dbaef182398841fdae4ade1cb2479491..dcb722bae2fa63703c7cd21e5caa73777118def3 100644 (file)
@@ -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);
index 879d7eaf851042b9c37f6357830877048ba5239d..46479d908065d563806ea3a2b2f20341bdf15921 100644 (file)
@@ -38,7 +38,9 @@
 #include <string.h>
 #include <pwd.h>
 #include <time.h>
+#if !defined(CSRG_BASED)
 #include <values.h>
+#endif
 #ifdef SunOS
 #include <sys/systeminfo.h>
 #endif
index 7c0852f4cb3ccc6e479c7437136cb2c41ce866aa..35591083b40b1949c9614f2b93549cc95c22fb74 100644 (file)
@@ -38,7 +38,9 @@
 #include <string.h>
 #include <pwd.h>
 #include <time.h>
+#if !defined(CSRG_BASED)
 #include <values.h>
+#endif
 #ifdef SunOS
 #include <sys/systeminfo.h>
 #endif
index 5a5ac6a1f0858e270251fae42f4421a65e053f27..883aba64f2705ac534a50fbf989884cbb374e304 100644 (file)
@@ -38,7 +38,9 @@
 #include <string.h>
 #include <pwd.h>
 #include <time.h>
+#if !defined(CSRG_BASED)
 #include <values.h>
+#endif
 #ifdef SunOS
 #include <sys/systeminfo.h>
 #endif
index fb6aab00d07af6f29f21fc91893f1b32028e174e..061b63dc9d30ba7573c398cb9989cd7776cf2677 100644 (file)
 #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);
 }
 
index 62230ad5b7b5f5add64bb7f304aa0d5fbf641b70..d329f6846954acf2786f4955de2c03ad02035263 100644 (file)
@@ -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);
index 5861b92864442214a78ddce547f1bf7b4b88eb1a..ed20fca2af607b2ab0c87f9854247f694b1193f9 100644 (file)
@@ -38,7 +38,9 @@
 #include <string.h>
 #include <pwd.h>
 #include <time.h>
+#if !defined(CSRG_BASED)
 #include <values.h>
+#endif
 #ifdef SunOS
 #include <sys/systeminfo.h>
 #endif
index af97c4b29bb81f5e1bbbd6b468c1760c1aced4a4..d4eceba9e111f857dd1051b8e89098bd0f3be056 100644 (file)
 #include <string.h>
 #include <pwd.h>
 #include <time.h>
+#if defined(CSRG_BASED)
+#include <sys/limits.h>
+#define MAXINT INT_MAX
+#else
 #include <values.h>
+#endif
 #ifdef SunOS
 #include <sys/systeminfo.h>
 #endif