[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#917000: rustc: Please include patch to fix incorrect fnctls on sparc64



On 12/21/18 10:48 AM, John Paul Adrian Glaubitz wrote:
> The patch contains a bogus hunk at the bottom, cleaned up patch attached.

And this time, I messed up the formatting. *sigh*

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Use correct fnctl constants for sparc64
Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Bug: https://github.com/rust-lang/rust/issues/57007
Last-Update: 2018-12-21

Index: rustc-1.31.0+dfsg1/src/librustc_data_structures/flock.rs
===================================================================
--- rustc-1.31.0+dfsg1.orig/src/librustc_data_structures/flock.rs
+++ rustc-1.31.0+dfsg1/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")]

Reply to: