From 9fd9caccfaa17902afebe0f17c729f1631759763 Mon Sep 17 00:00:00 2001 From: Ella Stanforth Date: Mon, 22 Sep 2025 18:58:41 +0000 Subject: [PATCH 1/3] m4: use libc::c_char --- m4/src/macros/builtin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/src/macros/builtin.rs b/m4/src/macros/builtin.rs index 22b49284..e1a5567a 100644 --- a/m4/src/macros/builtin.rs +++ b/m4/src/macros/builtin.rs @@ -785,7 +785,7 @@ fn mkstemp(mut template: Vec) -> Result> { // SAFETY: According to https://man7.org/linux/man-pages/man3/mkstemp.3.html it seems like this is correct. let file_descriptor = unsafe { // Docs: https://pubs.opengroup.org/onlinepubs/009604499/functions/mkstemp.html - libc::mkstemp(template_pointer as *mut i8) + libc::mkstemp(template_pointer as *mut libc::c_char) }; if file_descriptor < 0 { let e = errno::errno(); From 25050510c9ca85e5da18db69b19da8b636eb123a Mon Sep 17 00:00:00 2001 From: Ella Stanforth Date: Mon, 22 Sep 2025 18:59:06 +0000 Subject: [PATCH 2/3] mkfifo: use libc::c_char --- tree/mkfifo.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tree/mkfifo.rs b/tree/mkfifo.rs index 86bc7e89..11f7f895 100644 --- a/tree/mkfifo.rs +++ b/tree/mkfifo.rs @@ -31,7 +31,12 @@ fn do_mkfifo(filename: &str, mode: &ChmodMode) -> io::Result<()> { ChmodMode::Symbolic(sym) => modestr::mutate(0o666, false, sym), }; - let res = unsafe { libc::mkfifo(filename.as_ptr() as *const i8, mode_val as libc::mode_t) }; + let res = unsafe { + libc::mkfifo( + filename.as_ptr() as *const libc::c_char, + mode_val as libc::mode_t, + ) + }; if res < 0 { return Err(io::Error::last_os_error()); } From effb6752947adcb04db79cf2ccb336a1a100f33f Mon Sep 17 00:00:00 2001 From: Ella Stanforth Date: Mon, 22 Sep 2025 18:59:22 +0000 Subject: [PATCH 3/3] touch: use libc::c_char --- tree/touch.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tree/touch.rs b/tree/touch.rs index 10270e2e..c7812edf 100644 --- a/tree/touch.rs +++ b/tree/touch.rs @@ -139,7 +139,7 @@ fn parse_tm_ref_file(filename: &str) -> Result, Box Result<(), Box> { // open file for writing, creating if necessary let flags = libc::O_CREAT | libc::O_WRONLY | libc::O_TRUNC; - let fd = unsafe { libc::open(filename.as_ptr() as *const i8, flags, 0o666) }; + let fd = unsafe { libc::open(filename.as_ptr() as *const libc::c_char, flags, 0o666) }; if fd < 0 { return Err("Failed to open file".into()); } @@ -219,7 +219,7 @@ fn touch_file_existing( ]; // set file times - if unsafe { libc::utimes(filename.as_ptr() as *const i8, times.as_ptr()) } < 0 { + if unsafe { libc::utimes(filename.as_ptr() as *const libc::c_char, times.as_ptr()) } < 0 { return Err("Failed to change file times".into()); }