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;
28
28
use std:: io;
29
29
use std:: os;
30
30
use std:: run;
31
- use std:: libc:: exit;
32
31
33
32
enum ValidUsage {
34
33
Valid ( int ) , Invalid
@@ -235,7 +234,7 @@ pub fn main() {
235
234
236
235
if ( os_args. len ( ) > 1 && ( os_args[ 1 ] == ~"-v" || os_args[ 1 ] == ~"--version") ) {
237
236
rustc:: version ( os_args[ 0 ] ) ;
238
- unsafe { exit ( 0 ) ; }
237
+ return ;
239
238
}
240
239
241
240
let args = os_args. tail ( ) ;
@@ -245,8 +244,11 @@ pub fn main() {
245
244
for command in r. iter ( ) {
246
245
let result = do_command ( command, args. tail ( ) ) ;
247
246
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
250
252
}
251
253
}
252
254
}
You can’t perform that action at this time.
0 commit comments