From 341fd7ca16aae5190eedd8408aa2519398287366 Mon Sep 17 00:00:00 2001 From: PolyMeilex Date: Thu, 25 Jan 2024 19:58:38 +0100 Subject: [PATCH] Revert to octal mode repr in autoload and io --- src/autoload.rs | 7 +------ src/io.rs | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/autoload.rs b/src/autoload.rs index 4b3b74d3d..c02e3d7bf 100644 --- a/src/autoload.rs +++ b/src/autoload.rs @@ -341,12 +341,7 @@ fn test_autoload() { let fd = wopen_cloexec( path, OFlag::O_RDWR | OFlag::O_CREAT, - Mode::S_IRUSR - | Mode::S_IWUSR - | Mode::S_IRGRP - | Mode::S_IWGRP - | Mode::S_IROTH - | Mode::S_IWOTH, + Mode::from_bits(0o666).unwrap(), ) .unwrap(); write_loop(&fd, "Hello".as_bytes()).unwrap(); diff --git a/src/io.rs b/src/io.rs index c1841b3f1..53fc7ebf5 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1007,12 +1007,7 @@ const FILE_ERROR: &wstr = L!("An error occurred while redirecting file '%ls'"); const NOCLOB_ERROR: &wstr = L!("The file '%ls' already exists"); /// Base open mode to pass to calls to open. -const OPEN_MASK: Mode = Mode::S_IRUSR - .union(Mode::S_IWUSR) - .union(Mode::S_IRGRP) - .union(Mode::S_IWGRP) - .union(Mode::S_IROTH) - .union(Mode::S_IWOTH); +const OPEN_MASK: Mode = unsafe { Mode::from_bits_unchecked(0o666) }; /// Provide the fd monitor used for background fillthread operations. fn fd_monitor() -> &'static mut FdMonitor {