From: Marcin Cieslak Date: Thu, 23 Aug 2012 14:40:38 +0000 (+0200) Subject: 64bit: Fix crash in dtexec X-Git-Tag: 2.2.0b~54 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=98b17d35517648112c1db57a94b9540d34663352;p=oweals%2Fcde.git 64bit: Fix crash in dtexec No ANSI prototype for malloc() caused the returned pointer to be truncated to 32 bits. --- diff --git a/cde/lib/DtSvc/DtUtil2/DtGetMessage.c b/cde/lib/DtSvc/DtUtil2/DtGetMessage.c index 527a3486..b1fe32cf 100644 --- a/cde/lib/DtSvc/DtUtil2/DtGetMessage.c +++ b/cde/lib/DtSvc/DtUtil2/DtGetMessage.c @@ -40,6 +40,7 @@ #ifndef NO_MESSAGE_CATALOG #include +#include #include #include #include "DtSvcLock.h" diff --git a/cde/lib/DtSvc/DtUtil2/MsgLog.c b/cde/lib/DtSvc/DtUtil2/MsgLog.c index 8d3dd82a..0aa48d1d 100644 --- a/cde/lib/DtSvc/DtUtil2/MsgLog.c +++ b/cde/lib/DtSvc/DtUtil2/MsgLog.c @@ -145,7 +145,7 @@ static char * get_file_name ( va_list args; file = malloc(MAXPATHLEN+1); - if (! file) return; + if (! file) return NULL; Va_start (args, format); diff --git a/cde/programs/dtexec/Main.c b/cde/programs/dtexec/Main.c index 3c359f00..71f77eee 100644 --- a/cde/programs/dtexec/Main.c +++ b/cde/programs/dtexec/Main.c @@ -59,6 +59,9 @@ #include "osdep.h" /* select(2) mask width and bit manipulation macros */ #include #include +#include +#include +#include #include
@@ -320,7 +323,7 @@ Help( *****************************************************************************/ static void -#if defined(__aix) || defined (__osf__) +#if defined(__aix) || defined (__osf__) || defined(__FreeBSD__) PanicSignal(int s) #else PanicSignal(void) @@ -357,7 +360,7 @@ PanicSignal(void) *****************************************************************************/ static void -#if defined(__aix) || defined (__osf__) +#if defined(__aix) || defined (__osf__) || defined(__FreeBSD__) IgnoreSignal(int i) #else IgnoreSignal(void) @@ -399,7 +402,7 @@ IgnoreSignal(void) *****************************************************************************/ static void -#if defined(__aix) || defined (__osf__) +#if defined(__aix) || defined (__osf__) || defined(__FreeBSD__) UrgentSignal(int i) #else UrgentSignal(void) @@ -450,7 +453,7 @@ UrgentSignal(void) * *****************************************************************************/ static void -#if defined(__aix) || defined (__osf__) +#if defined(__aix) || defined (__osf__) || defined(__FreeBSD__) SigCld(int i) #else SigCld(void) @@ -769,7 +772,7 @@ ParseCommandLine( #endif /* _DTEXEC_NLS16 */ if (tick2) - *tick2 = NULL; + *tick2 = 0; #ifdef _DTEXEC_NLS16 tick1 = (char *) Dt_strrchr( dtSvcProcIdG, '_' ); @@ -778,8 +781,8 @@ ParseCommandLine( #endif /* _DTEXEC_NLS16 */ if ( tick1 && tick2 ) { - *tick1 = NULL; - *tick2 = NULL; + *tick1 = 0; + *tick2 = 0; dtSvcInvIdG = atoi((char *) (tick1 + 1)); dtSvcChildIdG = atoi((char *) (tick2 + 1)); @@ -1520,7 +1523,7 @@ main ( * a SIGCLD, give up and exit. */ if (rediscoverUrgentSigG > ((1000/SHORT_SELECT_TIMEOUT)*5) ) { -#if defined(__aix) || defined (__osf__) +#if defined(__aix) || defined (__osf__) || defined(__FreeBSD__) PanicSignal(0); #else PanicSignal();