File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ extern mod rustc;
2828use std:: io;
2929use std:: os;
3030use std:: run;
31- use std:: libc:: exit;
3231
3332enum ValidUsage {
3433 Valid ( int ) , Invalid
@@ -235,7 +234,7 @@ pub fn main() {
235234
236235 if ( os_args. len ( ) > 1 && ( os_args[ 1 ] == ~"-v" || os_args[ 1 ] == ~"--version") ) {
237236 rustc:: version ( os_args[ 0 ] ) ;
238- unsafe { exit ( 0 ) ; }
237+ return ;
239238 }
240239
241240 let args = os_args. tail ( ) ;
@@ -245,8 +244,11 @@ pub fn main() {
245244 for command in r. iter ( ) {
246245 let result = do_command ( command, args. tail ( ) ) ;
247246 match result {
248- Valid ( exit_code) => unsafe { exit ( exit_code. to_i32 ( ) ) } ,
249- _ => loop
247+ Valid ( exit_code) => {
248+ os:: set_exit_status ( exit_code) ;
249+ return ;
250+ }
251+ _ => loop
250252 }
251253 }
252254 }
You can’t perform that action at this time.
0 commit comments