X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2Fsyscalls.c;h=60b7d952ed53fbae526efe418de13dc321017166;hb=7b64f5e7f00e445a5637e9e3289a1332a14d28e5;hp=48305e3568d2c9a7707ae9a9e3da191fae49cf0e;hpb=5b5ee32779c93bf44c03d91ea6476eb9a711d231;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/syscalls.c b/AcessNative/ld-acess_src/syscalls.c index 48305e35..60b7d952 100644 --- a/AcessNative/ld-acess_src/syscalls.c +++ b/AcessNative/ld-acess_src/syscalls.c @@ -14,12 +14,6 @@ #endif #include "request.h" -#if SYSCALL_TRACE -#define DEBUG(str, x...) Debug(str, x) -#else -#define DEBUG(...) do{}while(0) -#endif - #define assert(cnd) do{ \ if( !(cnd) ) { \ fprintf(stderr, "%s:%i - assert failed - " #cnd"\n", __FILE__, __LINE__);\ @@ -32,6 +26,7 @@ // === Types === // === IMPORTS === +extern int gbSyscallDebugEnabled; // === GLOBALS === FILE *gaSyscall_LocalFPs[MAX_FPS]; @@ -286,7 +281,9 @@ uint64_t _Syscall(int SyscallID, const char *ArgTypes, ...) free( req ); free( retPtrs ); - DEBUG(": %i 0x%llx", SyscallID, retValue); + if( gbSyscallDebugEnabled ) { + SYSTRACE(": %i 0x%llx", SyscallID, retValue); + } return retValue; } @@ -345,12 +342,18 @@ int native_execve(const char *filename, const char *const argv[], const char *co int native_spawn(const char *filename, const char *const argv[], const char *const envp[]) { int rv; - + + fprintf(stderr, "native_spawn('%s')\n", filename); + #if __WIN32__ rv = _spawnve(_P_NOWAIT, filename, argv, envp); #else rv = posix_spawn(NULL, filename, NULL, NULL, (void*)argv, (void*)envp); #endif + if( rv == 0 ) { + perror("native_spawn"); + } + return rv; }