From 6d0a4370fbed997f2b622c694b56f68ccfb8b667 Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Wed, 11 Feb 2026 09:47:44 -0800 Subject: [PATCH] fix efault in settimeofday --- src/clock/timeofday.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/clock/timeofday.rs b/src/clock/timeofday.rs index 0381b29..b056829 100644 --- a/src/clock/timeofday.rs +++ b/src/clock/timeofday.rs @@ -32,8 +32,11 @@ pub async fn sys_gettimeofday(tv: TUA, tz: TUA) -> Result, _tz: TUA) -> Result { - let time: TimeSpec = copy_from_user(tv).await?; - let duration: Duration = time.into(); - set_date(duration); + // TODO: Handle timezone + if !tv.is_null() { + let time: TimeSpec = copy_from_user(tv).await?; + let duration: Duration = time.into(); + set_date(duration); + } Ok(0) }