AcessNative - Spawn in libacess-native (with AN_GETPATH syscall)
[tpg/acess2.git] / AcessNative / ld-acess_src / syscalls.c
index 34132c6..60b7d95 100644 (file)
@@ -26,6 +26,7 @@
 // === Types ===
 
 // === IMPORTS ===
+extern int     gbSyscallDebugEnabled;
 
 // === GLOBALS ===
 FILE   *gaSyscall_LocalFPs[MAX_FPS];
@@ -280,7 +281,9 @@ uint64_t _Syscall(int SyscallID, const char *ArgTypes, ...)
        free( req );
        free( retPtrs );
        
-       SYSTRACE(": %i 0x%llx", SyscallID, retValue);
+       if( gbSyscallDebugEnabled ) {
+               SYSTRACE(": %i 0x%llx", SyscallID, retValue);
+       }
        
        return retValue;
 }
@@ -339,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;
 }

UCC git Repository :: git.ucc.asn.au