From c0db46221473617f65c4fe8adbf7dbe9dde15b83 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 8 Mar 2018 21:37:07 +0100 Subject: [PATCH] Re-apply statvfs patch Signed-off-by: Igor Gnatenko --- ...vfs-to-be-available-wherever-they-ar.patch | 66 +++++++++++++++++++ rust-nix.spec | 7 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 0001-make-statfs-statvfs-to-be-available-wherever-they-ar.patch diff --git a/0001-make-statfs-statvfs-to-be-available-wherever-they-ar.patch b/0001-make-statfs-statvfs-to-be-available-wherever-they-ar.patch new file mode 100644 index 0000000..7994209 --- /dev/null +++ b/0001-make-statfs-statvfs-to-be-available-wherever-they-ar.patch @@ -0,0 +1,66 @@ +From 340c5742ce33fe633e74d0273f341d1653ebeff4 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Mon, 8 Jan 2018 00:13:59 +0100 +Subject: [PATCH] make statfs/statvfs to be available wherever they are + available + +libc reads sys/statvfs.h on all OS except Windows which nix doesn't care +about. + +Closes: https://github.com/nix-rust/nix/issues/831 +Signed-off-by: Igor Gnatenko +(cherry picked from commit 08624d0a5c3649fea6463836690ae9b7f01093ac) +--- + src/sys/mod.rs | 13 +------------ + src/sys/statvfs.rs | 6 +++--- + 2 files changed, 4 insertions(+), 15 deletions(-) + +diff --git a/src/sys/mod.rs b/src/sys/mod.rs +index a94b8a0..395f04e 100644 +--- a/src/sys/mod.rs ++++ b/src/sys/mod.rs +@@ -63,19 +63,8 @@ pub mod select; + pub mod quota; + + +-#[cfg(all(target_os = "linux", +- any(target_arch = "x86", +- target_arch = "x86_64", +- target_arch = "arm")), +- )] ++#[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] + pub mod statfs; + +- +-#[cfg(all(any(target_os = "linux", +- target_os = "macos"), +- any(target_arch = "x86", +- target_arch = "x86_64", +- target_arch = "arm")), +- )] + pub mod statvfs; + pub mod pthread; +diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs +index fbd0570..c1c66de 100644 +--- a/src/sys/statvfs.rs ++++ b/src/sys/statvfs.rs +@@ -32,13 +32,13 @@ libc_bitflags!( + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_MANDLOCK; + /// Write on file/directory/symlink +- #[cfg(any(target_os = "android", target_os = "linux"))] ++ #[cfg(target_os = "linux")] + ST_WRITE; + /// Append-only file +- #[cfg(any(target_os = "android", target_os = "linux"))] ++ #[cfg(target_os = "linux")] + ST_APPEND; + /// Immutable file +- #[cfg(any(target_os = "android", target_os = "linux"))] ++ #[cfg(target_os = "linux")] + ST_IMMUTABLE; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] +-- +2.16.2 + diff --git a/rust-nix.spec b/rust-nix.spec index 0ac908d..27e5566 100644 --- a/rust-nix.spec +++ b/rust-nix.spec @@ -6,7 +6,7 @@ Name: rust-%{crate} Version: 0.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Rust friendly bindings to *nix APIs License: MIT @@ -15,6 +15,8 @@ Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{ # Initial patched metadata # * No dragonfly Patch0: nix-0.10.0-fix-metadata.diff +# https://github.com/nix-rust/nix/commit/08624d0a5c3649fea6463836690ae9b7f01093ac +Patch1: 0001-make-statfs-statvfs-to-be-available-wherever-they-ar.patch ExclusiveArch: %{rust_arches} @@ -69,6 +71,9 @@ which use %{crate} from crates.io. %exclude %{cargo_registry}/%{crate}-%{version}/{Cross.toml,RELEASE_PROCEDURE.md,bors.toml,ci} %changelog +* Thu Mar 08 2018 Igor Gnatenko - 0.10.0-2 +- Re-apply statvfs patch + * Thu Mar 08 2018 Igor Gnatenko - 0.10.0-1 - Update to 0.10.0