From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B6D1864439 for ; Sun, 19 Jul 2020 20:18:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A8CC72729B for ; Sun, 19 Jul 2020 20:18:30 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 20A0D27292 for ; Sun, 19 Jul 2020 20:18:30 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D8DC043137 for ; Sun, 19 Jul 2020 20:18:29 +0200 (CEST) From: Thomas Lamprecht To: pbs-devel@lists.proxmox.com Date: Sun, 19 Jul 2020 20:17:57 +0200 Message-Id: <20200719181757.21397-1-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.243 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] applied: [PATCH backup] tools/xattr: a char from C is not universally a rust i8 X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2020 18:18:30 -0000 Make it actually do the correct cast by using `libc::c_char`. Fixes issues when building on other platforms, e.g., the aarch64 client only build on Arch Linux ARM I tested in my free time. Signed-off-by: Thomas Lamprecht --- src/tools/xattr.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/xattr.rs b/src/tools/xattr.rs index 9710236..6b712d1 100644 --- a/src/tools/xattr.rs +++ b/src/tools/xattr.rs @@ -82,7 +82,7 @@ pub fn flistxattr(fd: RawFd) -> Result { let mut size = 256; let mut buffer = vec::undefined(size); let mut bytes = unsafe { - libc::flistxattr(fd, buffer.as_mut_ptr() as *mut i8, buffer.len()) + libc::flistxattr(fd, buffer.as_mut_ptr() as *mut libc::c_char, buffer.len()) }; while bytes < 0 { let err = Errno::last(); @@ -96,7 +96,7 @@ pub fn flistxattr(fd: RawFd) -> Result { // Retry to read the list with new buffer buffer.resize(size, 0); bytes = unsafe { - libc::flistxattr(fd, buffer.as_mut_ptr() as *mut i8, buffer.len()) + libc::flistxattr(fd, buffer.as_mut_ptr() as *mut libc::c_char, buffer.len()) }; } buffer.truncate(bytes as usize); @@ -125,7 +125,7 @@ pub fn fgetxattr(fd: RawFd, name: &CStr) -> Result, nix::errno::Errno> { } buffer.resize(size, 0); bytes = unsafe { - libc::fgetxattr(fd, name.as_ptr() as *const i8, buffer.as_mut_ptr() as *mut core::ffi::c_void, buffer.len()) + libc::fgetxattr(fd, name.as_ptr() as *const libc::c_char, buffer.as_mut_ptr() as *mut core::ffi::c_void, buffer.len()) }; } buffer.resize(bytes as usize, 0); -- 2.20.1