diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2015-02-23 23:50:32 +0100 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2015-02-23 23:52:24 +0100 |
| commit | d0c589d5ced5006f72d766af2ccecf699ff76176 (patch) | |
| tree | e0451b5827c034ed764575aa5a2f9126df8af466 /src/libstd/sys/unix/process.rs | |
| parent | f0f7ca27de6b4e03f30012656dad270cda55a363 (diff) | |
| download | rust-d0c589d5ced5006f72d766af2ccecf699ff76176.tar.gz rust-d0c589d5ced5006f72d766af2ccecf699ff76176.zip | |
Hide unnecessary error checking from the user
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as "short UDP writes", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
Diffstat (limited to 'src/libstd/sys/unix/process.rs')
| -rw-r--r-- | src/libstd/sys/unix/process.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 2be841989e6..dc067e7e0c5 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -345,8 +345,8 @@ impl Process { unsafe { let mut pipes = [0; 2]; assert_eq!(libc::pipe(pipes.as_mut_ptr()), 0); - set_nonblocking(pipes[0], true).ok().unwrap(); - set_nonblocking(pipes[1], true).ok().unwrap(); + set_nonblocking(pipes[0], true); + set_nonblocking(pipes[1], true); WRITE_FD = pipes[1]; let mut old: c::sigaction = mem::zeroed(); @@ -362,7 +362,7 @@ impl Process { fn waitpid_helper(input: libc::c_int, messages: Receiver<Req>, (read_fd, old): (libc::c_int, c::sigaction)) { - set_nonblocking(input, true).ok().unwrap(); + set_nonblocking(input, true); let mut set: c::fd_set = unsafe { mem::zeroed() }; let mut tv: libc::timeval; let mut active = Vec::<(libc::pid_t, Sender<ProcessExit>, u64)>::new(); |
