Skip to content

Commit 73bd80b

Browse files
Merge pull request #14 from equation314/dev
Fix fnctl nonblock check
2 parents ca66c01 + 233ccdd commit 73bd80b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/src/fs/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl FileHandle {
146146
}
147147

148148
pub fn fcntl(&mut self, cmd: usize, arg: usize) -> Result<()> {
149-
if arg == 2048 && cmd == 4 {
149+
if arg & 0x800 > 0 && cmd == 4 {
150150
self.options.nonblock = true;
151151
}
152152
Ok(())

kernel/src/syscall/mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl Syscall<'_> {
6060
#[cfg(feature = "board_raspi3")]
6161
let attr = attr.mmio(crate::arch::paging::MMIOType::NormalNonCacheable as u8);
6262

63-
if let Some(fb) = FRAME_BUFFER.lock().as_mut() {
63+
if let Some(fb) = FRAME_BUFFER.lock().as_ref() {
6464
self.vm().push(
6565
addr,
6666
addr + len,

0 commit comments

Comments
 (0)