changeset 48962:59be65b7cdfd stable

rust-hg-core: use correct type for libc hostname buffer The type of libc::c_char is u8 on aarch64 rather than i8, which causes the use of a specifically-typed constant to fail. Differential Revision: https://phab.mercurial-scm.org/D12373
author Luke Granger-Brown <hg@lukegb.com>
date Mon, 14 Mar 2022 14:10:41 +0000
parents 1ceca11e6546
children 9ce563fb2989
files rust/hg-core/src/lock.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/lock.rs	Tue Mar 01 16:39:14 2022 +0100
+++ b/rust/hg-core/src/lock.rs	Mon Mar 14 14:10:41 2022 +0000
@@ -145,7 +145,7 @@
 
         /// Same as https://github.com/python/cpython/blob/v3.10.0/Modules/socketmodule.c#L5414
         const BUFFER_SIZE: usize = 1024;
-        let mut buffer = [0_i8; BUFFER_SIZE];
+        let mut buffer = [0 as libc::c_char; BUFFER_SIZE];
         let hostname_bytes = unsafe {
             let result = libc::gethostname(buffer.as_mut_ptr(), BUFFER_SIZE);
             if result != 0 {