dtcm: Resolve CID 87822
[oweals/cde.git] / cde / programs / dtcm / server / rtable4.c
index fb6aab00d07af6f29f21fc91893f1b32028e174e..4fdf17e12573f91d61c5bf9214d86bc89ff827d7 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);
 }
 
@@ -1541,12 +1554,10 @@ _DtCm_rtable_rename_4_svc(Table_Op_Args_4 *args, struct svc_req *svcrq)
 extern void *
 _DtCm_rtable_ping_4_svc(void *args, struct svc_req *svcrq)
 {
-       char dummy;
-
        if (debug)
                fprintf(stderr, "_DtCm_rtable_ping_4_svc called\n");
 
-       return((void *)&dummy); /* for RPC reply */
+       return(NULL); /* for RPC reply */
 }
 
 extern void