From 922aaf1cb0546041c9260424861e2c335502febf Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Mon, 28 Jan 2019 06:02:48 +0000 Subject: [PATCH] d-sparc64-fix-fnctls Gbp-Pq: Name d-sparc64-fix-fnctls.patch --- src/librustc_data_structures/flock.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs index 86e48e2162..d48814055f 100644 --- a/src/librustc_data_structures/flock.rs +++ b/src/librustc_data_structures/flock.rs @@ -42,11 +42,21 @@ cfg_if! { pub l_sysid: libc::c_int, } - pub const F_RDLCK: libc::c_short = 0; - pub const F_WRLCK: libc::c_short = 1; - pub const F_UNLCK: libc::c_short = 2; - pub const F_SETLK: libc::c_int = 6; - pub const F_SETLKW: libc::c_int = 7; + cfg_if! { + if #[cfg(target_arch = "sparc64")] { + pub const F_RDLCK: libc::c_short = 1; + pub const F_WRLCK: libc::c_short = 2; + pub const F_UNLCK: libc::c_short = 3; + pub const F_SETLK: libc::c_int = 8; + pub const F_SETLKW: libc::c_int = 9; + } else { + pub const F_RDLCK: libc::c_short = 0; + pub const F_WRLCK: libc::c_short = 1; + pub const F_UNLCK: libc::c_short = 2; + pub const F_SETLK: libc::c_int = 6; + pub const F_SETLKW: libc::c_int = 7; + } + } } #[cfg(target_os = "freebsd")] -- 2.30.2