Usermode/libc - Fix strchr and strrchr behavior
[tpg/acess2.git] / KernelLand / Kernel / binary.c
index 3dab6a9..5170dac 100644 (file)
@@ -231,23 +231,19 @@ int Proc_int_Execve(const char *File, const char **ArgV, const char **EnvP, int
        }
 
        // --- Get argc 
-       for( argc = 0; ArgV && ArgV[argc]; argc ++ );
+       for( argc = 0; ArgV && ArgV[argc]; argc ++ )
+               ;
        
        // --- Set Process Name
        Threads_SetName(File);
        
        // --- Clear User Address space
-       // NOTE: This is a little roundabout, maybe telling ClearUser to not touch the
-       //       PPD area would be a better idea.
        if( bClearUser )
        {
-                int    nfd = *Threads_GetMaxFD();
-               void    *handles;
-               handles = VFS_SaveHandles(nfd, NULL);
-               VFS_CloseAllUserHandles();
+               // MM_ClearUser should preserve handles
                MM_ClearUser();
-               VFS_RestoreHandles(nfd, handles);
-               VFS_FreeSavedHandles(nfd, handles);
+               // - NOTE: Not a reliable test, but helps for now
+               ASSERTC( VFS_IOCtl(0, 0, NULL), !=, -1 );
        }
        
        // --- Load new binary
@@ -334,6 +330,8 @@ tVAddr Binary_Load(const char *Path, tVAddr *EntryPoint)
        if(pBinary->Interpreter) {
                tVAddr  start;
                if( Binary_Load(pBinary->Interpreter, &start) == 0 ) {
+                       Log_Error("Binary", "Can't load interpeter '%s' for '%s'",
+                               pBinary->Interpreter, Path);
                        LEAVE('x', 0);
                        return 0;
                }

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