Lite2 bugfixes merge:

so_linger is in seconds, not in 1/HZ
range checking in SO_*TIMEO was wrong

PR: 11252
This commit is contained in:
Andrey A. Chernov 1999-04-24 18:22:34 +00:00
parent fdbad643d5
commit 02a3d5261d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46014

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
* $Id: uipc_socket.c,v 1.54 1999/02/02 07:23:28 fenner Exp $
* $Id: uipc_socket.c,v 1.55 1999/02/16 10:49:49 dfr Exp $
*/
#include <sys/param.h>
@ -258,7 +258,7 @@ soclose(so)
goto drop;
while (so->so_state & SS_ISCONNECTED) {
error = tsleep((caddr_t)&so->so_timeo,
PSOCK | PCATCH, "soclos", so->so_linger);
PSOCK | PCATCH, "soclos", so->so_linger * hz);
if (error)
break;
}
@ -1049,7 +1049,7 @@ sosetopt(so, sopt)
if (error)
goto bad;
if (tv.tv_sec > SHRT_MAX / hz - hz) {
if (tv.tv_sec * hz + tv.tv_usec / tick > SHRT_MAX) {
error = EDOM;
goto bad;
}