1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

OpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD. Apart from that, mainly #ifdefs.

This commit is contained in:
Pascal Stumpf 2012-08-10 14:44:57 +02:00 committed by Jon Trulson
parent 3718075b7c
commit 57463ec10e
10 changed files with 34 additions and 1 deletions

View file

@ -54,7 +54,9 @@ static char sccsid[] = "@(#)graphics.c 1.23 94/11/29 Copyr 1994 Sun Microsystem
#include <EUSCompat.h> #include <EUSCompat.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#if !defined(CSRG_BASED)
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
#endif
#include <sys/param.h> /* MAXPATHLEN defined here */ #include <sys/param.h> /* MAXPATHLEN defined here */
#ifdef SVR4 #ifdef SVR4
#include <sys/utsname.h> /* SYS_NMLN */ #include <sys/utsname.h> /* SYS_NMLN */

View file

@ -65,7 +65,9 @@ static char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 1993 Sun Microsystems
#define STANDARD 2 #define STANDARD 2
#define MAYBE 3 #define MAYBE 3
#ifdef SVR4
extern long timezone; extern long timezone;
#endif
%} %}

View file

@ -1008,6 +1008,7 @@ init_time()
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
_Xgtimeparams gmtime_buf; _Xgtimeparams gmtime_buf;
#ifdef SVR4
/* Fix for QAR 31607 */ /* Fix for QAR 31607 */
tzset(); tzset();
if (getenv("TZ") == NULL){ if (getenv("TZ") == NULL){
@ -1017,6 +1018,7 @@ init_time()
putenv(tzptr); putenv(tzptr);
tzset(); tzset();
} }
#endif
t = now(); t = now();
tm = *_XLocaltime(&t, localtime_buf); tm = *_XLocaltime(&t, localtime_buf);

View file

@ -38,7 +38,9 @@
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include <time.h> #include <time.h>
#if !defined(CSRG_BASED)
#include <values.h> #include <values.h>
#endif
#ifdef SunOS #ifdef SunOS
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#endif #endif

View file

@ -38,7 +38,9 @@
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include <time.h> #include <time.h>
#if !defined(CSRG_BASED)
#include <values.h> #include <values.h>
#endif
#ifdef SunOS #ifdef SunOS
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#endif #endif

View file

@ -38,7 +38,9 @@
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include <time.h> #include <time.h>
#if !defined(CSRG_BASED)
#include <values.h> #include <values.h>
#endif
#ifdef SunOS #ifdef SunOS
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#endif #endif

View file

@ -45,7 +45,11 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/signal.h> #include <sys/signal.h>
#include <rpc/rpc.h> #include <rpc/rpc.h>
#if defined(CSRG_BASED)
#define MAXINT INT_MAX
#else
#include <values.h> #include <values.h>
#endif
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#ifdef SUNOS #ifdef SUNOS
@ -1406,12 +1410,21 @@ extern long *
_DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq) _DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq)
{ {
static long gmtoff; static long gmtoff;
#if !defined(CSRG_BASED)
extern long timezone; extern long timezone;
#else
struct tm *t;
#endif
if (debug) if (debug)
fprintf(stderr, "_DtCm_rtable_gmtoff_4_svc called\n"); fprintf(stderr, "_DtCm_rtable_gmtoff_4_svc called\n");
#if defined(CSRG_BASED)
t = localtime(time(NULL));
gmtoff = t->tm_gmtoff;
#else
gmtoff = timezone; gmtoff = timezone;
#endif
return(&gmtoff); return(&gmtoff);
} }

View file

@ -702,7 +702,8 @@ main(int argc, char **argv)
if (udp_transp == (SVCXPRT *)-1) { if (udp_transp == (SVCXPRT *)-1) {
udp_transp = svcudp_create(standalone ? RPC_ANYSOCK : 0 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 #else
,0,0); ,0,0);

View file

@ -38,7 +38,9 @@
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include <time.h> #include <time.h>
#if !defined(CSRG_BASED)
#include <values.h> #include <values.h>
#endif
#ifdef SunOS #ifdef SunOS
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#endif #endif

View file

@ -36,7 +36,12 @@
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include <time.h> #include <time.h>
#if defined(CSRG_BASED)
#include <sys/limits.h>
#define MAXINT INT_MAX
#else
#include <values.h> #include <values.h>
#endif
#ifdef SunOS #ifdef SunOS
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#endif #endif