Revert "Merge branch 'rustifying' into 'master'"

This reverts merge request !663
This commit is contained in:
Jeremy Soller
2025-07-06 12:54:39 -06:00
parent 84d4100845
commit 5673575354
4 changed files with 53 additions and 21 deletions
+9 -1
View File
@@ -791,12 +791,20 @@ pub unsafe extern "C" fn mkostemps(
suffix_len: c_int,
mut flags: c_int,
) -> c_int {
// TODO: Rustify impl
flags &= !O_ACCMODE;
flags |= O_RDWR | O_CREAT | O_EXCL;
inner_mktemp(name, suffix_len, || {
let name = CStr::from_ptr(name);
Sys::open(name, flags, 0o600).ok()
let fd = Sys::open(name, flags, 0o600).or_minus_one_errno();
if fd >= 0 {
Some(fd)
} else {
None
}
})
.unwrap_or(-1)
}