Skip to content

Commit 94630e4

Browse files
committed
No need to zero when an initializer for the object is already used.
1 parent f463386 commit 94630e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/sys/unix/process/process_unix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ impl Command {
280280
}
281281

282282
unsafe {
283-
let mut file_actions = PosixSpawnFileActions(mem::zeroed());
284-
let mut attrs = PosixSpawnattr(mem::zeroed());
283+
let mut file_actions = PosixSpawnFileActions(mem::uninitialized());
284+
let mut attrs = PosixSpawnattr(mem::uninitialized());
285285

286286
libc::posix_spawnattr_init(&mut attrs.0);
287287
libc::posix_spawn_file_actions_init(&mut file_actions.0);
@@ -302,7 +302,7 @@ impl Command {
302302
libc::STDERR_FILENO))?;
303303
}
304304

305-
let mut set: libc::sigset_t = mem::zeroed();
305+
let mut set: libc::sigset_t = mem::uninitialized();
306306
cvt(libc::sigemptyset(&mut set))?;
307307
cvt(libc::posix_spawnattr_setsigmask(&mut attrs.0,
308308
&set))?;

0 commit comments

Comments
 (0)