correct previous, fix reversed test, remove memset.

This commit is contained in:
christos 2009-01-14 23:28:23 +00:00
parent 574c2ab1b1
commit 6e8bc6579f

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_socket.c,v 1.180 2009/01/14 20:33:19 cegger Exp $ */
/* $NetBSD: uipc_socket.c,v 1.181 2009/01/14 23:28:23 christos Exp $ */
/*-
* Copyright (c) 2002, 2007, 2008 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.180 2009/01/14 20:33:19 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.181 2009/01/14 23:28:23 christos Exp $");
#include "opt_compat_netbsd.h"
#include "opt_sock_counters.h"
@ -1587,8 +1587,6 @@ sosetopt1(struct socket *so, const struct sockopt *sopt)
struct linger l;
struct timeval tv;
memset(&tv, 0, sizeof(struct timeval));
switch ((opt = sopt->sopt_name)) {
case SO_ACCEPTFILTER:
@ -1701,7 +1699,7 @@ sosetopt1(struct socket *so, const struct sockopt *sopt)
case SO_SNDTIMEO:
case SO_RCVTIMEO:
if (error)
if (error == 0)
error = sockopt_get(sopt, &tv, sizeof(tv));
solock(so);
if (error)