@@ -39,15 +39,13 @@ #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #if defined(OF_MORPHOS) && !defined(OF_IXEMUL) # define BOOL EXEC_BOOL -# include +# include # include # undef BOOL -# define getpid() ((int)SysBase->ThisTask) -extern struct ExecBase *SysBase; #endif /* References for static linking */ #ifdef OF_WINDOWS void @@ -101,11 +99,11 @@ of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: 0]; of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: 1]; of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: 2]; # else BPTR input = Input(), output = Output(); - BPTR error = ((struct Process *)SysBase->ThisTask)->pr_CES; + BPTR error = ((struct Process *)FindTask(NULL))->pr_CES; bool inputClosable = false, outputClosable = false, errorClosable = false; if (input == 0) { input = Open("*", MODE_OLDFILE);