From 1a84d6b362cdb05577f739d1d0bdc06c9a23b197 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Sat, 4 May 2013 11:25:02 +0200 Subject: [PATCH] Skip timeout computation in is_syscall_restarted case. --- headers/private/net/ProtocolUtilities.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/headers/private/net/ProtocolUtilities.h b/headers/private/net/ProtocolUtilities.h index e296ce3e9e..0423d0565f 100644 --- a/headers/private/net/ProtocolUtilities.h +++ b/headers/private/net/ProtocolUtilities.h @@ -367,18 +367,16 @@ DECL_DATAGRAM_SOCKET(inline void)::_NotifyOneReader(bool notifySocket) DECL_DATAGRAM_SOCKET(inline bigtime_t)::_SocketTimeout(uint32 flags) const { - bigtime_t timeout = fSocket->receive.timeout; + if (ModuleBundle::Stack()->is_restarted_syscall()) + return ModuleBundle::Stack()->restore_syscall_restart_timeout(); + bigtime_t timeout = fSocket->receive.timeout; if ((flags & MSG_DONTWAIT) != 0) timeout = 0; else if (timeout != 0 && timeout != B_INFINITE_TIMEOUT) timeout += system_time(); - if (ModuleBundle::Stack()->is_restarted_syscall()) - timeout = ModuleBundle::Stack()->restore_syscall_restart_timeout(); - else - ModuleBundle::Stack()->store_syscall_restart_timeout(timeout); - + ModuleBundle::Stack()->store_syscall_restart_timeout(timeout); return timeout; }