From: Volker Lendecke Date: Tue, 21 May 2024 06:38:19 +0000 (+0200) Subject: smbd: Simplify request_timed_out X-Git-Tag: tdb-1.4.11~609 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2b692fb458f0253adcb8b7ae2b9eb99346559fb;p=thirdparty%2Fsamba.git smbd: Simplify request_timed_out timeval_expired does what we need here Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 04d0e1e0336..f714b75d472 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2825,10 +2825,8 @@ static NTSTATUS handle_share_mode_lease( static bool request_timed_out(struct smb_request *req, struct timeval timeout) { - struct timeval now, end_time; - GetTimeOfDay(&now); - end_time = timeval_sum(&req->request_time, &timeout); - return (timeval_compare(&end_time, &now) < 0); + struct timeval end_time = timeval_sum(&req->request_time, &timeout); + return timeval_expired(&end_time); } struct defer_open_state {