diff options
author | wollman <wollman@FreeBSD.org> | 1995-02-16 01:07:43 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-02-16 01:07:43 +0000 |
commit | 60c4643ea36b652c18ecae18191a86ee241b4cb4 (patch) | |
tree | 30cdaf67a94784e0068dd2b7beb1f808304a483b /sys | |
parent | 0f1c96e35914243f7be1dd758c1d9c2b5aa97d23 (diff) | |
download | FreeBSD-src-60c4643ea36b652c18ecae18191a86ee241b4cb4.zip FreeBSD-src-60c4643ea36b652c18ecae18191a86ee241b4cb4.tar.gz |
getsockopt(s, SOL_SOCKET, SO_SNDTIMEO, ...) would construct the returned
timeval incorrectly, truncating the usec part.
Obtained from: Stevens vol. 2 p. 548
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_socket.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 277ce52..5e3bd97 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -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; } |