File tree 2 files changed +3
-5
lines changed
src/libstd/sys/unix/process
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ mod tests {
437
437
438
438
#[ cfg( target_os = "android" ) ]
439
439
unsafe fn sigemptyset ( set : * mut libc:: sigset_t ) -> libc:: c_int {
440
- libc :: memset ( set as * mut _ , 0 , mem :: size_of :: < libc :: sigset_t > ( ) ) ;
440
+ set. write_bytes ( 0u8 , 1 ) ;
441
441
return 0 ;
442
442
}
443
443
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ impl Command {
202
202
// emscripten has no signal support.
203
203
#[ cfg( not( any( target_os = "emscripten" ) ) ) ]
204
204
{
205
- use crate :: mem:: { self , MaybeUninit } ;
205
+ use crate :: mem:: MaybeUninit ;
206
206
// Reset signal handling so the child process starts in a
207
207
// standardized state. libstd ignores SIGPIPE, and signal-handling
208
208
// libraries often set a mask. Child processes inherit ignored
@@ -215,9 +215,7 @@ impl Command {
215
215
// Implementing sigemptyset allow us to support older Android
216
216
// versions. See the comment about Android and sig* functions in
217
217
// process_common.rs
218
- libc:: memset ( set. as_mut_ptr ( ) as * mut _ ,
219
- 0 ,
220
- mem:: size_of :: < libc:: sigset_t > ( ) ) ;
218
+ set. as_mut_ptr ( ) . write_bytes ( 0u8 , 1 ) ;
221
219
} else {
222
220
cvt ( libc:: sigemptyset ( set. as_mut_ptr ( ) ) ) ?;
223
221
}
You can’t perform that action at this time.
0 commit comments