diff --git a/src/core/msystem.cpp b/src/core/msystem.cpp index 7fe2052..39e3e21 100644 --- a/src/core/msystem.cpp +++ b/src/core/msystem.cpp @@ -740,7 +740,6 @@ FILE *fp; return(-1); } - /* * like popen but A LOT safer * uses file descriptors for all three files @@ -867,6 +866,10 @@ FILE *fp[]; return(mfpclose(indx, fp)); } +#ifdef __AROS__ + #define fork() vfork() +#endif + /* * signal values */ @@ -893,7 +896,6 @@ int mask; register int i; /* counter in for loop */ register int ch_pid; /* child PID */ register int euid, egid; /* in case reset[gu]id is -1 */ - /* * create 1 pipe for each of standard input, output, error */ @@ -989,7 +991,6 @@ int mask; (void) close(p[2][0]); } } - /* * return child's PID */ diff --git a/src/core/timeconvert.cpp b/src/core/timeconvert.cpp index 5508a79..3eb59e1 100644 --- a/src/core/timeconvert.cpp +++ b/src/core/timeconvert.cpp @@ -54,6 +54,10 @@ #define TIME_MAX 2147483647L // largest signed 32 bit number +#ifdef __AROS__ + #define tzset() +#endif + struct tm* cTimeUtil::TimeToDateGMT( const int64& seconds ) { ASSERT( seconds < TIME_MAX );// this assumes time_t size is 32 bit. Yikes! diff --git a/src/core/tw_signal.cpp b/src/core/tw_signal.cpp index 6e03c7d..9277653 100644 --- a/src/core/tw_signal.cpp +++ b/src/core/tw_signal.cpp @@ -77,6 +77,11 @@ void util_SignalHandler( int sig ) } #if IS_UNIX + +#ifndef NSIG + #define NSIG 32 +#endif + void tw_psignal(int sig, const TCHAR *str) { const TCHAR *siglist[NSIG] = { diff --git a/src/core/twlocale.cpp b/src/core/twlocale.cpp index b528eca..549502f 100644 --- a/src/core/twlocale.cpp +++ b/src/core/twlocale.cpp @@ -66,6 +66,9 @@ static TSTRING& util_FormatTime( struct tm* ptm, TSTRING& strBuf ); // PUBLIC METHOD CODE //========================================================================= +#ifdef __AROS__ + #define tzset() +#endif void cTWLocale::InitGlobalLocale() { @@ -243,7 +246,6 @@ TSTRING& cTWLocale::FormatTime( int64 t, TSTRING& strBuf ) { // clear return string strBuf.erase(); - tzset(); time_t tmpTime = t; struct tm * ptm = localtime( &tmpTime ); diff --git a/src/tripwire/smtpmailmessage.cpp b/src/tripwire/smtpmailmessage.cpp index 84ec72c..86adc1a 100644 --- a/src/tripwire/smtpmailmessage.cpp +++ b/src/tripwire/smtpmailmessage.cpp @@ -66,6 +66,12 @@ #define INVALID_SOCKET -1 +#ifdef __AROS__ + #ifndef HAVE_GETHOSTNAME + #define HAVE_GETHOSTNAME 1 + #endif +#endif + #ifndef HAVE_GETHOSTNAME static int gethostname( char* name, int namelen ) { @@ -87,7 +93,6 @@ static int gethostname( char* name, int namelen ) } } #endif - // Unix does not require us to go though any silly DLL hoops, so we'll // just #define the pointers to functions needed by Windows to be the // berkely functions. diff --git a/src/tripwire/syslog_trip.cpp b/src/tripwire/syslog_trip.cpp index dab273a..44fc0fb 100644 --- a/src/tripwire/syslog_trip.cpp +++ b/src/tripwire/syslog_trip.cpp @@ -54,6 +54,12 @@ #include "tw/twerrors.h" #include "tw/twstrings.h" +#ifdef __AROS__ + #include + #define openlog(a,b,c) + #define closelog() +#endif + /////////////////////////////////////////////////////////////////////////////// // Syslog /////////////////////////////////////////////////////////////////////////////// @@ -91,11 +97,9 @@ void cSyslog::Log(const TCHAR* programName, cSyslog::LogType logType, const TCHA const char* msg = message; #endif -#ifndef SKYOS // Handle an oddball OS that has syslog.h but doesn't implement the calls. openlog(ident, LOG_PID, LOG_USER); syslog(LOG_NOTICE, "%s", msg); closelog(); -#endif #elif SUPPORTS_EVENTLOG diff --git a/src/tw/twinit.cpp b/src/tw/twinit.cpp index 5e1af78..8747f7e 100644 --- a/src/tw/twinit.cpp +++ b/src/tw/twinit.cpp @@ -79,6 +79,13 @@ #include "core/tw_signal.h" // to ignore SIGPIPE #endif +#ifdef __AROS__ +#include +#include +#include + +static bool aros_socketbase_init(); +#endif //============================================================================= // cTWInit_i @@ -238,6 +245,9 @@ void cTWInit::Init( const TSTRING& strArgv0 ) // END:RAD // ------------------------------------------------------------ +#ifdef __AROS__ + aros_socketbase_init(); +#endif // // set up the file system services // @@ -305,4 +315,27 @@ void cTWInit::Init( const TSTRING& strArgv0 ) } +#ifdef __AROS__ +struct Library* SocketBase=0; + +bool aros_socketbase_init() +{ + if (!(SocketBase = OpenLibrary("bsdsocket.library", 4))) + { + printf("Failed to load socket library"); + return 0; + } + + if (SocketBaseTags( + SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (IPTR)&errno, + SBTM_SETVAL(SBTC_HERRNOLONGPTR), (IPTR)&errno, + TAG_DONE)) + { + printf("Failed to init socket library"); + return 0; + } + return 1; +} +#endif +