diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2004-07-22 20:40:23 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2004-07-22 20:40:23 +0000 |
| commit | a6719c82b1c3be242512d7d331ab8b356265e468 (patch) | |
| tree | 95b7d1934613c9a5f984e154aa98d365d5b39d72 /sys/kern/sys_socket.c | |
| parent | 0ab1b47fd4c19b0e85265f3f1d74b3baccb4bccb (diff) | |
Notes
Diffstat (limited to 'sys/kern/sys_socket.c')
| -rw-r--r-- | sys/kern/sys_socket.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index e1de4b79702d..cbaa587b7ae3 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -225,9 +225,11 @@ soo_stat(fp, ub, active_cred, td) struct thread *td; { struct socket *so = fp->f_data; + int error; bzero((caddr_t)ub, sizeof (*ub)); ub->st_mode = S_IFSOCK; + NET_LOCK_GIANT(); /* * If SBS_CANTRCVMORE is set, but there's still data left in the * receive buffer, the socket is still readable. @@ -244,7 +246,9 @@ soo_stat(fp, ub, active_cred, td) ub->st_size = so->so_rcv.sb_cc - so->so_rcv.sb_ctl; ub->st_uid = so->so_cred->cr_uid; ub->st_gid = so->so_cred->cr_gid; - return ((*so->so_proto->pr_usrreqs->pru_sense)(so, ub)); + error = (*so->so_proto->pr_usrreqs->pru_sense)(so, ub); + NET_UNLOCK_GIANT(); + return (error); } /* |
