Skip timeout computation in is_syscall_restarted case.

This commit is contained in:
Philippe Houdoin
2013-05-04 11:27:04 +02:00
parent 843a122fd9
commit 1a84d6b362
+3 -5
View File
@@ -367,18 +367,16 @@ DECL_DATAGRAM_SOCKET(inline void)::_NotifyOneReader(bool notifySocket)
DECL_DATAGRAM_SOCKET(inline bigtime_t)::_SocketTimeout(uint32 flags) const 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) if ((flags & MSG_DONTWAIT) != 0)
timeout = 0; timeout = 0;
else if (timeout != 0 && timeout != B_INFINITE_TIMEOUT) else if (timeout != 0 && timeout != B_INFINITE_TIMEOUT)
timeout += system_time(); 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; return timeout;
} }