Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion m4/src/macros/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ fn mkstemp(mut template: Vec<u8>) -> Result<Vec<u8>> {
// 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();
Expand Down
7 changes: 6 additions & 1 deletion tree/mkfifo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions tree/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fn parse_tm_ref_file(filename: &str) -> Result<DateTime<Utc>, Box<dyn std::error
fn touch_file_new(time: libc::time_t, filename: &str) -> Result<(), Box<dyn std::error::Error>> {
// 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());
}
Expand Down Expand Up @@ -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());
}

Expand Down