Usermode/crt0 - Fixed crt0 not calling _exit
authorJohn Hodge <[email protected]>
Fri, 2 Dec 2011 03:02:31 +0000 (11:02 +0800)
committerJohn Hodge <[email protected]>
Fri, 2 Dec 2011 03:02:31 +0000 (11:02 +0800)
Usermode/Libraries/crt0.o_src/crt0.c

index 7c0e3ff..cb42772 100644 (file)
@@ -8,8 +8,9 @@ typedef void    (*constructor_t)(void);
 
 exithandler_t  _crt0_exit_handler;
 extern constructor_t   _crtbegin_ctors[];
+extern void    _exit(int status) __attribute__((noreturn));
 
-int start(int argc, char *argv[], char **envp)
+void start(int argc, char *argv[], char **envp)
 {
         int    i;
         int    rv;
@@ -21,6 +22,6 @@ int start(int argc, char *argv[], char **envp)
        
        if( _crt0_exit_handler )
                _crt0_exit_handler();
-       
-       return rv;
+
+       _exit(rv);
 }

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