From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 0ED261FF0B0 for ; Fri, 09 Oct 2026 15:05:56 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D291B2177C; Fri, 09 Oct 2026 15:05:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jing.rocks; h=cc :cc:content-transfer-encoding:date:from:from:message-id :mime-version:reply-to:subject:subject:to:to; s=mail-gw; bh=dlKp +0O3GcyB9Jd6rdEFtP3UMNBYLEpq7F/yvTTJOx8=; b=lNFOlv9VINUvgZuP2t4Y kqM6gn/IY7ieDBh8SXU1azGw/F386+78m88cFvMFLGlpaf4aPaZXUQ/H+hwtzsSH CI43vC4T8rd+tNOIAkodlYsszfC5ZRKr7ru20HAMK4WEOWmRAng4vx3mXxesvTcm beL6rmn8qLT6Ah58OfHjnOUptbAx6IGg+FHip0JDQONrM+0C6ZPBaJMWLNc8uTwi JyXTEJ3kW/DfdQGNaDCZ7RyvuqnakIi2woxTEnzX9kTwTWt9Ld0eX6CvWSJFpna5 lzeKhcCYVc7Di4b6ZjUe6xhCeaO5rxAhna48VK0r144vFs+4g/J6Embr9s5/Vozp rA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jing.rocks; s=default; t=1791551076; bh=pNGRRJWvFKGfxkWP3e0/3ShNFZKQmYsxU1+49dr2WFQ=; h=From:To:Cc:Subject:Date:From; b=hChXUFan32HYGVj7mAafLICN8JybZdJgQV8Bm5NgUQ/nZW/9GefGbLUIu0skIeB+6 e6K1sRUwfVIpy6L/cT+l3xnkBizgh5KvKfSLE4Frx4ieS69JLPeabU1iEn4IsyjD+Z S3MtH0D9MaBXqLoKV2NWx921+Q9MhU2IycNVkUvzFH60DL+gF5K3DxhdvkiGQ8hxiD Bb+IQRIX0RbdPn4cO6tjBhim574fNiDC3NvCbEoJPNGf3Oj6vlOw0CDBQp7wnfHJYC 9D4V9YWze+0tQh9igDF8ZjMNMXXwSpsdiliZ0A3zESSDXcIH5EtOzbPYca4o2YGgh2 32yumQUrhT78w== From: Luke Yasuda To: pve-devel@lists.proxmox.com Subject: [PATCH v2 proxmox-rrd-migration-tool] use libc::c_char instead of i8 to fix mismatched type Date: Fri, 9 Oct 2026 22:02:07 +0900 Message-ID: <20261009130412.927074-1-jing@jing.rocks> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy KAM_INFOUSMEBIZ 0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware KAM_OTHER_BAD_TLD 0.75 Other untrustworthy TLDs SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: T34KCYXAW2PJ4C4HBD4U2VV5QFQGT4RX X-Message-ID-Hash: T34KCYXAW2PJ4C4HBD4U2VV5QFQGT4RX X-MailFrom: jing@jing.rocks X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Luke Yasuda X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Otherwise this fails on non-amd64 arches: error[E0308]: mismatched types --> src/main.rs:374:17 | 374 | source[0] = file.0.as_ptr(); | --------- ^^^^^^^^^^^^^^^ expected `*const i8`, found `*const u8` | | | expected due to the type of this binding | = note: expected raw pointer `*const i8` found raw pointer `*const u8` error[E0308]: mismatched types --> src/main.rs:386:13 | 381 | let res = rrd_create_r2( | ------------- arguments to this function are incorrect ... 386 | source.as_mut_ptr(), | ^^^^^^^^^^^^^^^^^^^ expected `*mut *const u8`, found `*mut *const i8` | = note: expected raw pointer `*mut *const u8` found raw pointer `*mut *const i8` Signed-off-by: Luke Yasuda --- Use std::ffi:c_char instead of the one from libc crate. I don't know what I'm doing. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 799cde8..40acb08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use std::{ - ffi::{CStr, CString, OsString}, + ffi::{c_char, CStr, CString, OsString}, fs, io::ErrorKind, os::unix::{ffi::OsStrExt, fs::PermissionsExt}, @@ -370,7 +370,7 @@ fn do_rrd_migration( bail!("refusing to migrate metrics for {resource:?} - target already exists and 'force' not set!"); } - let mut source: [*const i8; 2] = [std::ptr::null(); 2]; + let mut source: [*const c_char; 2] = [std::ptr::null(); 2]; source[0] = file.0.as_ptr(); let target_path = CString::new(target_path.to_str().unwrap()).unwrap(); -- 2.55.0