# HG changeset patch # User Luke Granger-Brown # Date 2022-03-14 14:10:41 # Node ID 8e828c0f647b2e11b732df56b7848f5608e8708f # Parent 8dec9abf26697fc963041d672231fe7749eb8c25 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 diff --git a/rust/hg-core/src/lock.rs b/rust/hg-core/src/lock.rs --- a/rust/hg-core/src/lock.rs +++ b/rust/hg-core/src/lock.rs @@ -145,7 +145,7 @@ lazy_static::lazy_static! { /// 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 {