Browse Source

fix: socket shutdown wrong implement (#893)

Samuel Dai 6 months ago
parent
commit
09836e1b39
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kernel/src/net/syscall.rs

+ 1 - 1
kernel/src/net/syscall.rs

@@ -345,7 +345,7 @@ impl Syscall {
             .get_socket(fd as i32)
             .ok_or(SystemError::EBADF)?;
         let mut socket = unsafe { socket.inner_no_preempt() };
-        socket.shutdown(ShutdownType::from_bits_truncate(how as u8))?;
+        socket.shutdown(ShutdownType::from_bits_truncate((how + 1) as u8))?;
         return Ok(0);
     }