From 184ecb76bdd7cc8bd5414df58c30bbb2294c6cc3 Mon Sep 17 00:00:00 2001 From: TTaq <1405522135@qq.com> Date: Mon, 22 Apr 2024 10:49:33 +0800 Subject: [PATCH] 1 --- kernel/src/net/event_poll/mod.rs | 12 +----------- kernel/src/net/event_poll/syscall.rs | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/kernel/src/net/event_poll/mod.rs b/kernel/src/net/event_poll/mod.rs index 8c8920f50..8e8aafa8a 100644 --- a/kernel/src/net/event_poll/mod.rs +++ b/kernel/src/net/event_poll/mod.rs @@ -868,7 +868,7 @@ bitflags! { } } -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Default)] #[repr(C)] struct CPollfd { fd: i32, @@ -876,16 +876,6 @@ struct CPollfd { revents: i16, } -impl Default for CPollfd { - fn default() -> Self { - Self { - fd: 0, - events: 0, - revents: 0, - } - } -} - #[derive(Debug, Clone)] pub struct Pollfd { fd: Option, diff --git a/kernel/src/net/event_poll/syscall.rs b/kernel/src/net/event_poll/syscall.rs index 96975d105..21c92aa17 100644 --- a/kernel/src/net/event_poll/syscall.rs +++ b/kernel/src/net/event_poll/syscall.rs @@ -195,7 +195,7 @@ impl Syscall { return Ok(0); } - if !timespec.is_none() && timespec.unwrap().tv_sec == 0 { + if timespec.is_some() && timespec.unwrap().tv_sec == 0 { return Ok(0); }