d-sparc64-fix-fnctls
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Sun, 17 Mar 2019 23:40:05 +0000 (23:40 +0000)
committerXimin Luo <infinity0@debian.org>
Sun, 17 Mar 2019 23:40:05 +0000 (23:40 +0000)
Gbp-Pq: Name d-sparc64-fix-fnctls.patch

src/librustc_data_structures/flock.rs

index 86e48e21626abd39b4a9546c237de189595464f9..66bc6a4a54ed01a5da0bc1c53e8c5423c26fb045 100644 (file)
@@ -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")]