File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
crates/svm-rs/src/bin/solc Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 9
9
#![ cfg_attr( docsrs, feature( doc_cfg, doc_auto_cfg) ) ]
10
10
11
11
use anyhow:: Context ;
12
- use std:: process:: { Command , Stdio } ;
12
+ use std:: io;
13
+ use std:: process:: { Command , ExitStatus , Stdio } ;
13
14
14
15
fn main ( ) {
15
16
let code = match main_ ( ) {
@@ -54,11 +55,22 @@ fn main_() -> anyhow::Result<i32> {
54
55
) ;
55
56
}
56
57
57
- let status = Command :: new ( bin)
58
- . args ( args)
58
+ let mut cmd = Command :: new ( bin) ;
59
+ cmd . args ( args)
59
60
. stdin ( Stdio :: inherit ( ) )
60
61
. stdout ( Stdio :: inherit ( ) )
61
- . stderr ( Stdio :: inherit ( ) )
62
- . status ( ) ?;
63
- Ok ( status. code ( ) . unwrap_or ( -1 ) )
62
+ . stderr ( Stdio :: inherit ( ) ) ;
63
+ Ok ( exec ( & mut cmd) ?. code ( ) . unwrap_or ( -1 ) )
64
+ }
65
+
66
+ fn exec ( cmd : & mut Command ) -> io:: Result < ExitStatus > {
67
+ #[ cfg( unix) ]
68
+ {
69
+ use std:: os:: unix:: prelude:: * ;
70
+ Err ( cmd. exec ( ) )
71
+ }
72
+ #[ cfg( not( unix) ) ]
73
+ {
74
+ cmd. status ( )
75
+ }
64
76
}
You can’t perform that action at this time.
0 commit comments