mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-17 14:04:34 +01:00
Merge 'core/io: Don't open file as non-blocking in Unix backend' from Pekka Enberg
The Unix backend is a syscall()-based, blocking implementation. The O_NONBLOCK adds nothing. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #2708
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::Result;
|
||||
use parking_lot::Mutex;
|
||||
use rustix::{
|
||||
fd::{AsFd, AsRawFd},
|
||||
fs::{self, FlockOperation, OFlags, OpenOptionsExt},
|
||||
fs::{self, FlockOperation},
|
||||
};
|
||||
use std::os::fd::RawFd;
|
||||
|
||||
@@ -97,7 +97,7 @@ impl IO for UnixIO {
|
||||
fn open_file(&self, path: &str, flags: OpenFlags, _direct: bool) -> Result<Arc<dyn File>> {
|
||||
trace!("open_file(path = {})", path);
|
||||
let mut file = std::fs::File::options();
|
||||
file.read(true).custom_flags(OFlags::NONBLOCK.bits() as i32);
|
||||
file.read(true);
|
||||
|
||||
if !flags.contains(OpenFlags::ReadOnly) {
|
||||
file.write(true);
|
||||
|
||||
Reference in New Issue
Block a user