]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify request_timed_out
authorVolker Lendecke <vl@samba.org>
Tue, 21 May 2024 06:38:19 +0000 (08:38 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 04:23:29 +0000 (04:23 +0000)
timeval_expired does what we need here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/open.c

index 04d0e1e0336c1f0db41529ec45985d7267151897..f714b75d4725db4046fbd71653b18d1a6f3fdc05 100644 (file)
@@ -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 {