getsockopt(s, SOL_SOCKET, SO_SNDTIMEO, ...) would construct the returned

timeval incorrectly, truncating the usec part.

Obtained from: Stevens vol. 2 p. 548
This commit is contained in:
Garrett Wollman 1995-02-16 01:07:43 +00:00
parent 41f82abe5a
commit 5f540404a8

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
* $Id: uipc_socket.c,v 1.7 1995/02/06 02:22:12 davidg Exp $
* $Id: uipc_socket.c,v 1.8 1995/02/07 02:01:14 wollman Exp $
*/
#include <sys/param.h>
@ -1029,7 +1029,7 @@ sogetopt(so, level, optname, mp)
m->m_len = sizeof(struct timeval);
mtod(m, struct timeval *)->tv_sec = val / hz;
mtod(m, struct timeval *)->tv_usec =
(val % hz) / tick;
(val % hz) * tick;
break;
}