parent
07a53da1c2
commit
332d4add17
@ -0,0 +1,53 @@
|
||||
From 485f893f851eb3eb74ba32182a579c0faf10fd94 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <cuviper@gmail.com>
|
||||
Date: Mon, 26 Feb 2018 23:58:32 -0800
|
||||
Subject: [PATCH] Update to nix 0.10
|
||||
|
||||
---
|
||||
src/platform/unix.rs | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/platform/unix.rs b/src/platform/unix.rs
|
||||
index 18cf3d8..2bbd5e3 100644
|
||||
--- a/src/platform/unix.rs
|
||||
+++ b/src/platform/unix.rs
|
||||
@@ -44,7 +44,7 @@ pub unsafe fn init_os_handler() -> Result<(), Error> {
|
||||
use self::nix::fcntl;
|
||||
use self::nix::sys::signal;
|
||||
|
||||
- PIPE = unistd::pipe2(fcntl::O_CLOEXEC).map_err(|e| Error::System(nix_err_to_io_err(e)))?;
|
||||
+ PIPE = unistd::pipe2(fcntl::OFlag::O_CLOEXEC).map_err(|e| Error::System(nix_err_to_io_err(e)))?;
|
||||
|
||||
let close_pipe = |e: nix::Error| -> Error {
|
||||
unistd::close(PIPE.1).is_ok();
|
||||
@@ -53,12 +53,16 @@ pub unsafe fn init_os_handler() -> Result<(), Error> {
|
||||
};
|
||||
|
||||
// Make sure we never block on write in the os handler.
|
||||
- if let Err(e) = fcntl::fcntl(PIPE.1, fcntl::FcntlArg::F_SETFL(fcntl::O_NONBLOCK)) {
|
||||
+ if let Err(e) = fcntl::fcntl(PIPE.1, fcntl::FcntlArg::F_SETFL(fcntl::OFlag::O_NONBLOCK)) {
|
||||
return Err(close_pipe(e));
|
||||
}
|
||||
|
||||
let handler = signal::SigHandler::Handler(os_handler);
|
||||
- let new_action = signal::SigAction::new(handler, signal::SA_RESTART, signal::SigSet::empty());
|
||||
+ let new_action = signal::SigAction::new(
|
||||
+ handler,
|
||||
+ signal::SaFlags::SA_RESTART,
|
||||
+ signal::SigSet::empty(),
|
||||
+ );
|
||||
|
||||
let _old = match signal::sigaction(signal::Signal::SIGINT, &new_action) {
|
||||
Ok(old) => old,
|
||||
@@ -97,7 +101,7 @@ pub unsafe fn block_ctrl_c() -> Result<(), Error> {
|
||||
match unistd::read(PIPE.0, &mut buf[..]) {
|
||||
Ok(1) => break,
|
||||
Ok(_) => return Err(Error::System(io::ErrorKind::UnexpectedEof.into()).into()),
|
||||
- Err(nix::Error::Sys(nix::Errno::EINTR)) => {}
|
||||
+ Err(nix::Error::Sys(nix::errno::Errno::EINTR)) => {}
|
||||
Err(e) => return Err(Error::System(nix_err_to_io_err(e))),
|
||||
}
|
||||
}
|
||||
--
|
||||
2.16.2
|
||||
|
@ -1,11 +1,13 @@
|
||||
--- ctrlc-3.1.0/Cargo.toml 1970-01-01T01:00:00+01:00
|
||||
+++ ctrlc-3.1.0/Cargo.toml 2018-01-15T09:29:12.866855+01:00
|
||||
@@ -30,8 +30,3 @@
|
||||
+++ ctrlc-3.1.0/Cargo.toml 2018-03-08T21:10:30.966416+01:00
|
||||
@@ -29,9 +29,4 @@
|
||||
[features]
|
||||
termination = []
|
||||
[target."cfg(unix)".dependencies.nix]
|
||||
version = "0.9"
|
||||
-version = "0.9"
|
||||
-[target."cfg(windows)".dependencies.kernel32-sys]
|
||||
-version = "0.2"
|
||||
-
|
||||
-[target."cfg(windows)".dependencies.winapi]
|
||||
-version = "0.2"
|
||||
+version = "0.10"
|
||||
|
Loading…
Reference in new issue