diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-19 22:15:44 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-19 22:15:44 +0200 |
| commit | 471dd52d7710dcad5fec0cd731b836b02ba4a8f4 (patch) | |
| tree | 4f7a1b7fcf01c8fb5c255a5af32b3906b44d38fa /src/libstd/sys/unix | |
| parent | e88220f86749d88e53c5dbaa421dcaba1889f86c (diff) | |
| parent | d7f94516345a36ddfcd68cbdf1df835d356795c3 (diff) | |
| download | rust-471dd52d7710dcad5fec0cd731b836b02ba4a8f4.tar.gz rust-471dd52d7710dcad5fec0cd731b836b02ba4a8f4.zip | |
Fix merge conflict with recent PR
Diffstat (limited to 'src/libstd/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/process/process_unix.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libstd/sys/unix/process/process_unix.rs b/src/libstd/sys/unix/process/process_unix.rs index 371291b9f76..0f349dfa302 100644 --- a/src/libstd/sys/unix/process/process_unix.rs +++ b/src/libstd/sys/unix/process/process_unix.rs @@ -84,12 +84,12 @@ impl Command { Ok(0) => return Ok((p, ours)), Ok(8) => { let (errno, footer) = bytes.split_at(4); - assert!( - combine(CLOEXEC_MSG_FOOTER) == combine(footer.try_into().unwrap()), + assert_eq!( + CLOEXEC_MSG_FOOTER, footer, "Validation on the CLOEXEC pipe failed: {:?}", bytes ); - let errno = combine(errno.try_into().unwrap()); + let errno = i32::from_be_bytes(errno.try_into().unwrap()); assert!(p.wait().is_ok(), "wait() should either return Ok or panic"); return Err(Error::from_raw_os_error(errno)); } @@ -105,10 +105,6 @@ impl Command { } } } - - fn combine(arr: [u8; 4]) -> i32 { - i32::from_be_bytes(arr) - } } pub fn exec(&mut self, default: Stdio) -> io::Error { |
