File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
library/std/src/sys/unix/process Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -333,9 +333,20 @@ impl Command {
333333 let mut set = MaybeUninit :: < libc:: sigset_t > :: uninit ( ) ;
334334 cvt ( sigemptyset ( set. as_mut_ptr ( ) ) ) ?;
335335 cvt ( libc:: pthread_sigmask ( libc:: SIG_SETMASK , set. as_ptr ( ) , ptr:: null_mut ( ) ) ) ?;
336- let mut action: libc:: sigaction = mem:: zeroed ( ) ;
337- action. sa_sigaction = libc:: SIG_DFL ;
338- cvt ( libc:: sigaction ( libc:: SIGPIPE , & action, ptr:: null_mut ( ) ) ) ?;
336+
337+ #[ cfg( target_os = "android" ) ] // see issue #88585
338+ {
339+ let mut action: libc:: sigaction = mem:: zeroed ( ) ;
340+ action. sa_sigaction = libc:: SIG_DFL ;
341+ cvt ( libc:: sigaction ( libc:: SIGPIPE , & action, ptr:: null_mut ( ) ) ) ?;
342+ }
343+ #[ cfg( not( target_os = "android" ) ) ]
344+ {
345+ let ret = sys:: signal ( libc:: SIGPIPE , libc:: SIG_DFL ) ;
346+ if ret == libc:: SIG_ERR {
347+ return Err ( io:: Error :: last_os_error ( ) ) ;
348+ }
349+ }
339350 }
340351
341352 for callback in self . get_closures ( ) . iter_mut ( ) {
You can’t perform that action at this time.
0 commit comments