version 1.181, 2009/01/14 23:28:23 |
version 1.182, 2009/01/15 15:25:37 |
Line 1583 sorflush(struct socket *so) |
|
Line 1583 sorflush(struct socket *so) |
|
static int |
static int |
sosetopt1(struct socket *so, const struct sockopt *sopt) |
sosetopt1(struct socket *so, const struct sockopt *sopt) |
{ |
{ |
int error = 0, optval, opt; |
int error = EINVAL, optval, opt; |
struct linger l; |
struct linger l; |
struct timeval tv; |
struct timeval tv; |
|
|
Line 1692 sosetopt1(struct socket *so, const struc |
|
Line 1692 sosetopt1(struct socket *so, const struc |
|
error = sockopt_get(sopt, &otv, sizeof(otv)); |
error = sockopt_get(sopt, &otv, sizeof(otv)); |
timeval50_to_timeval(&otv, &tv); |
timeval50_to_timeval(&otv, &tv); |
opt = opt == SO_OSNDTIMEO ? SO_SNDTIMEO : SO_RCVTIMEO; |
opt = opt == SO_OSNDTIMEO ? SO_SNDTIMEO : SO_RCVTIMEO; |
error = 1; |
error = 0; |
/*FALLTHROUGH*/ |
/*FALLTHROUGH*/ |
} |
} |
#endif /* COMPAT_50 */ |
#endif /* COMPAT_50 */ |
|
|
case SO_SNDTIMEO: |
case SO_SNDTIMEO: |
case SO_RCVTIMEO: |
case SO_RCVTIMEO: |
if (error == 0) |
if (error) |
error = sockopt_get(sopt, &tv, sizeof(tv)); |
error = sockopt_get(sopt, &tv, sizeof(tv)); |
solock(so); |
solock(so); |
if (error) |
if (error) |