Bump nix to 0.10

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
epel9
Igor Gnatenko 7 years ago
parent 07a53da1c2
commit 332d4add17
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

@ -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"

@ -6,7 +6,7 @@
Name: rust-%{crate}
Version: 3.1.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Easy Ctrl-C handler for Rust projects
License: MIT or ASL 2.0
@ -14,13 +14,16 @@ URL: https://crates.io/crates/ctrlc
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
# Initial patched metadata
# * No windows
# * Bump nix to 0.10
Patch0: ctrlc-3.1.0-fix-metadata.diff
# Make it work with nix 0.10
Patch1: 0001-Update-to-nix-0.10.patch
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
# [dependencies]
BuildRequires: (crate(nix) >= 0.9.0 with crate(nix) < 0.10.0)
BuildRequires: (crate(nix) >= 0.10.0 with crate(nix) < 0.11.0)
%description
%{summary}.
@ -57,6 +60,9 @@ which use %{crate} from crates.io.
%exclude %{cargo_registry}/%{crate}-%{version}/appveyor.yml
%changelog
* Thu Mar 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.1.0-3
- Bump nix to 0.10
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

Loading…
Cancel
Save