diff -Nru rust-ctrlc-3.1.3/Cargo.lock rust-ctrlc-3.1.7/Cargo.lock --- rust-ctrlc-3.1.3/Cargo.lock 1970-01-01 00:00:00.000000000 +0000 +++ rust-ctrlc-3.1.7/Cargo.lock 2020-10-11 19:53:34.000000000 +0000 @@ -0,0 +1,69 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "bitflags" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ctrlc" +version = "3.1.7" +dependencies = [ + "nix 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libc" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "nix" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)" = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" +"checksum nix 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff -Nru rust-ctrlc-3.1.3/Cargo.toml rust-ctrlc-3.1.7/Cargo.toml --- rust-ctrlc-3.1.3/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-ctrlc-3.1.7/Cargo.toml 2020-10-11 19:53:34.000000000 +0000 @@ -12,13 +12,14 @@ [package] name = "ctrlc" -version = "3.1.3" +version = "3.1.7" authors = ["Antti Keränen "] exclude = ["/.travis.yml", "/appveyor.yml"] description = "Easy Ctrl-C handler for Rust projects" homepage = "https://github.com/Detegr/rust-ctrlc" documentation = "http://detegr.github.io/doc/ctrlc" keywords = ["ctrlc", "signal", "SIGINT"] +categories = ["os"] license = "MIT/Apache-2.0" repository = "https://github.com/Detegr/rust-ctrlc.git" @@ -30,7 +31,7 @@ [features] termination = [] [target."cfg(unix)".dependencies.nix] -version = "0.14" +version = "0.18" [target."cfg(windows)".dependencies.winapi] version = "0.3" features = ["consoleapi", "handleapi", "synchapi", "winbase"] diff -Nru rust-ctrlc-3.1.3/Cargo.toml.orig rust-ctrlc-3.1.7/Cargo.toml.orig --- rust-ctrlc-3.1.3/Cargo.toml.orig 2019-06-06 06:37:45.000000000 +0000 +++ rust-ctrlc-3.1.7/Cargo.toml.orig 2020-10-11 19:46:11.000000000 +0000 @@ -1,24 +1,25 @@ [package] name = "ctrlc" -version = "3.1.3" +version = "3.1.7" authors = ["Antti Keränen "] description = "Easy Ctrl-C handler for Rust projects" documentation = "http://detegr.github.io/doc/ctrlc" homepage = "https://github.com/Detegr/rust-ctrlc" keywords = ["ctrlc", "signal", "SIGINT"] +categories = ["os"] license = "MIT/Apache-2.0" repository = "https://github.com/Detegr/rust-ctrlc.git" exclude = ["/.travis.yml", "/appveyor.yml"] [target.'cfg(unix)'.dependencies] -nix = "0.14" +nix = "0.18" [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["consoleapi", "handleapi", "synchapi", "winbase"] } [target.'cfg(windows)'.dev-dependencies] winapi = { version = "0.3", features = ["fileapi", "processenv", "winnt"] } - + [features] termination = [] diff -Nru rust-ctrlc-3.1.3/.cargo_vcs_info.json rust-ctrlc-3.1.7/.cargo_vcs_info.json --- rust-ctrlc-3.1.3/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-ctrlc-3.1.7/.cargo_vcs_info.json 2020-10-11 19:53:34.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "e17f2886cd5c3bf69da506cd13fef0ca5ac7ec93" + "sha1": "f9de9565ad29d91c567071f9ed8018113227d12a" } } diff -Nru rust-ctrlc-3.1.3/debian/changelog rust-ctrlc-3.1.7/debian/changelog --- rust-ctrlc-3.1.3/debian/changelog 2020-01-09 01:24:19.000000000 +0000 +++ rust-ctrlc-3.1.7/debian/changelog 2020-11-04 22:12:43.000000000 +0000 @@ -1,3 +1,10 @@ +rust-ctrlc (3.1.7-1) unstable; urgency=medium + + * Team upload. + * Package ctrlc 3.1.7 from crates.io using debcargo 2.4.3 + + -- Andrej Shadura Wed, 04 Nov 2020 23:12:43 +0100 + rust-ctrlc (3.1.3-3) unstable; urgency=medium * Package ctrlc 3.1.3 from crates.io using debcargo 2.4.2 diff -Nru rust-ctrlc-3.1.3/debian/control rust-ctrlc-3.1.7/debian/control --- rust-ctrlc-3.1.3/debian/control 2020-01-09 01:24:19.000000000 +0000 +++ rust-ctrlc-3.1.7/debian/control 2020-11-04 22:12:43.000000000 +0000 @@ -6,7 +6,7 @@ cargo:native , rustc:native , libstd-rust-dev , - librust-nix-0.16+default-dev | librust-nix-0.15+default-dev | librust-nix-0.14+default-dev , + librust-nix+default-dev (>= 0.18-~~) , librust-winapi-0.3+consoleapi-dev , librust-winapi-0.3+default-dev , librust-winapi-0.3+handleapi-dev , @@ -14,7 +14,7 @@ librust-winapi-0.3+winbase-dev Maintainer: Debian Rust Maintainers Uploaders: - Paride Legovini , + Paride Legovini , Wolfgang Silbermayr Standards-Version: 4.4.1 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/ctrlc] @@ -26,7 +26,7 @@ Multi-Arch: same Depends: ${misc:Depends}, - librust-nix-0.16+default-dev | librust-nix-0.15+default-dev | librust-nix-0.14+default-dev, + librust-nix+default-dev (>= 0.18-~~), librust-winapi-0.3+consoleapi-dev, librust-winapi-0.3+default-dev, librust-winapi-0.3+handleapi-dev, @@ -41,9 +41,9 @@ librust-ctrlc-3.1-dev (= ${binary:Version}), librust-ctrlc-3.1+default-dev (= ${binary:Version}), librust-ctrlc-3.1+termination-dev (= ${binary:Version}), - librust-ctrlc-3.1.3-dev (= ${binary:Version}), - librust-ctrlc-3.1.3+default-dev (= ${binary:Version}), - librust-ctrlc-3.1.3+termination-dev (= ${binary:Version}) + librust-ctrlc-3.1.7-dev (= ${binary:Version}), + librust-ctrlc-3.1.7+default-dev (= ${binary:Version}), + librust-ctrlc-3.1.7+termination-dev (= ${binary:Version}) Description: Easy Ctrl-C handler for Rust projects - Rust source code This package contains the source for the Rust ctrlc crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-ctrlc-3.1.3/debian/copyright.debcargo.hint rust-ctrlc-3.1.7/debian/copyright.debcargo.hint --- rust-ctrlc-3.1.3/debian/copyright.debcargo.hint 2020-01-09 01:24:19.000000000 +0000 +++ rust-ctrlc-3.1.7/debian/copyright.debcargo.hint 2020-11-04 22:12:43.000000000 +0000 @@ -71,7 +71,7 @@ Files: debian/* Copyright: 2018-2020 Debian Rust Maintainers - 2018-2020 Paride Legovini + 2018-2020 Paride Legovini 2018-2020 Wolfgang Silbermayr License: MIT or Apache-2.0 diff -Nru rust-ctrlc-3.1.3/debian/debcargo.toml rust-ctrlc-3.1.7/debian/debcargo.toml --- rust-ctrlc-3.1.3/debian/debcargo.toml 2020-01-09 01:24:19.000000000 +0000 +++ rust-ctrlc-3.1.7/debian/debcargo.toml 2020-11-04 22:12:43.000000000 +0000 @@ -1,5 +1,5 @@ overlay = "." uploaders = [ - "Paride Legovini ", + "Paride Legovini ", "Wolfgang Silbermayr ", ] diff -Nru rust-ctrlc-3.1.3/debian/patches/relax-dep.diff rust-ctrlc-3.1.7/debian/patches/relax-dep.diff --- rust-ctrlc-3.1.3/debian/patches/relax-dep.diff 2020-01-09 01:24:19.000000000 +0000 +++ rust-ctrlc-3.1.7/debian/patches/relax-dep.diff 2020-11-04 22:12:43.000000000 +0000 @@ -1,13 +1,11 @@ -Index: ctrlc/Cargo.toml -=================================================================== ---- ctrlc.orig/Cargo.toml -+++ ctrlc/Cargo.toml -@@ -30,7 +30,7 @@ harness = false +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -31,7 +31,7 @@ harness = false [features] termination = [] [target."cfg(unix)".dependencies.nix] --version = "0.14" -+version = ">= 0.14, < 0.17" +-version = "0.18" ++version = ">= 0.18" [target."cfg(windows)".dependencies.winapi] version = "0.3" features = ["consoleapi", "handleapi", "synchapi", "winbase"] diff -Nru rust-ctrlc-3.1.3/debian/tests/control rust-ctrlc-3.1.7/debian/tests/control --- rust-ctrlc-3.1.3/debian/tests/control 2020-01-09 01:24:19.000000000 +0000 +++ rust-ctrlc-3.1.7/debian/tests/control 2020-11-04 22:12:43.000000000 +0000 @@ -1,9 +1,9 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test ctrlc 3.1.3 --all-targets --all-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test ctrlc 3.1.7 --all-targets --all-features Features: test-name=@ Depends: dh-cargo (>= 18), librust-winapi-0.3+default-dev, librust-winapi-0.3+fileapi-dev, librust-winapi-0.3+processenv-dev, librust-winapi-0.3+winnt-dev, @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test ctrlc 3.1.3 --all-targets --no-default-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test ctrlc 3.1.7 --all-targets --no-default-features Features: test-name=librust-ctrlc-dev Depends: dh-cargo (>= 18), librust-winapi-0.3+default-dev, librust-winapi-0.3+fileapi-dev, librust-winapi-0.3+processenv-dev, librust-winapi-0.3+winnt-dev, @ Restrictions: allow-stderr, skip-not-installable diff -Nru rust-ctrlc-3.1.3/src/error.rs rust-ctrlc-3.1.7/src/error.rs --- rust-ctrlc-3.1.3/src/error.rs 2019-06-06 06:34:28.000000000 +0000 +++ rust-ctrlc-3.1.7/src/error.rs 2020-07-29 09:50:50.000000000 +0000 @@ -12,6 +12,16 @@ System(std::io::Error), } +impl Error { + fn describe(&self) -> &str { + match *self { + Error::NoSuchSignal(_) => "Signal could not be found from the system", + Error::MultipleHandlers => "Ctrl-C signal handler already registered", + Error::System(_) => "Unexpected system error", + } + } +} + impl From<::platform::Error> for Error { fn from(e: ::platform::Error) -> Error { let system_error = std::io::Error::new(std::io::ErrorKind::Other, e); @@ -21,18 +31,13 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use std::error::Error; - write!(f, "Ctrl-C error: {}", self.description()) + write!(f, "Ctrl-C error: {}", self.describe()) } } impl std::error::Error for Error { fn description(&self) -> &str { - match *self { - Error::NoSuchSignal(_) => "Signal could not be found from the system", - Error::MultipleHandlers => "Ctrl-C signal handler already registered", - Error::System(_) => "Unexpected system error", - } + self.describe() } fn cause(&self) -> Option<&dyn std::error::Error> { diff -Nru rust-ctrlc-3.1.3/src/lib.rs rust-ctrlc-3.1.7/src/lib.rs --- rust-ctrlc-3.1.3/src/lib.rs 2019-06-06 05:39:38.000000000 +0000 +++ rust-ctrlc-3.1.7/src/lib.rs 2020-07-11 17:20:13.000000000 +0000 @@ -86,9 +86,9 @@ /// # Panics /// Any panic in the handler will not be caught and will cause the signal handler thread to stop. /// -pub fn set_handler(user_handler: F) -> Result<(), Error> +pub fn set_handler(mut user_handler: F) -> Result<(), Error> where - F: Fn() -> () + 'static + Send, + F: FnMut() -> () + 'static + Send, { if INIT.compare_and_swap(false, true, Ordering::SeqCst) { return Err(Error::MultipleHandlers); diff -Nru rust-ctrlc-3.1.3/src/platform/unix/mod.rs rust-ctrlc-3.1.7/src/platform/unix/mod.rs --- rust-ctrlc-3.1.3/src/platform/unix/mod.rs 2019-06-06 06:36:51.000000000 +0000 +++ rust-ctrlc-3.1.7/src/platform/unix/mod.rs 2020-10-11 19:45:31.000000000 +0000 @@ -28,6 +28,44 @@ } } +// pipe2(2) is not available on macOS or iOS, so we need to use pipe(2) and fcntl(2) +#[inline] +#[cfg(any(target_os = "ios", target_os = "macos"))] +fn pipe2(flags: nix::fcntl::OFlag) -> nix::Result<(RawFd, RawFd)> { + use self::nix::fcntl::{fcntl, FcntlArg, FdFlag, OFlag}; + + let pipe = unistd::pipe()?; + + let mut res = Ok(0); + + if flags.contains(OFlag::O_CLOEXEC) { + res = res + .and_then(|_| fcntl(pipe.0, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))) + .and_then(|_| fcntl(pipe.1, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))); + } + + if flags.contains(OFlag::O_NONBLOCK) { + res = res + .and_then(|_| fcntl(pipe.0, FcntlArg::F_SETFL(OFlag::O_NONBLOCK))) + .and_then(|_| fcntl(pipe.1, FcntlArg::F_SETFL(OFlag::O_NONBLOCK))); + } + + match res { + Ok(_) => Ok(pipe), + Err(e) => { + let _ = unistd::close(pipe.0); + let _ = unistd::close(pipe.1); + Err(e) + } + } +} + +#[inline] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +fn pipe2(flags: nix::fcntl::OFlag) -> nix::Result<(RawFd, RawFd)> { + unistd::pipe2(flags) +} + /// Register os signal handler. /// /// Must be called before calling [`block_ctrl_c()`](fn.block_ctrl_c.html) @@ -41,7 +79,7 @@ use self::nix::fcntl; use self::nix::sys::signal; - PIPE = unistd::pipe2(fcntl::OFlag::O_CLOEXEC)?; + PIPE = pipe2(fcntl::OFlag::O_CLOEXEC)?; let close_pipe = |e: nix::Error| -> Error { // Try to close the pipes. close() should not fail,