summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-08-04 18:53:50 +0000
committergreen <green@FreeBSD.org>1999-08-04 18:53:50 +0000
commitc03366a55d4ace981b016ae999ae67675c486cdd (patch)
tree12cd9e195ff9e1b516242767963c6e156b837539 /sys/kern/sys_socket.c
parent0ab4dad80912358b49a3cee9e433dbd909334d19 (diff)
downloadFreeBSD-src-c03366a55d4ace981b016ae999ae67675c486cdd.zip
FreeBSD-src-c03366a55d4ace981b016ae999ae67675c486cdd.tar.gz
Fix fd race conditions (during shared fd table usage.) Badfileops is
now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index ad92d87..123ff93 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)sys_socket.c 8.1 (Berkeley) 6/10/93
- * $Id: sys_socket.c,v 1.23 1999/02/01 21:16:29 newton Exp $
+ * $Id: sys_socket.c,v 1.24 1999/04/04 21:41:16 dt Exp $
*/
#include <sys/param.h>
@@ -171,6 +171,7 @@ soo_close(fp, p)
{
int error = 0;
+ fp->f_ops = &badfileops;
if (fp->f_data)
error = soclose((struct socket *)fp->f_data);
fp->f_data = 0;
OpenPOWER on IntegriCloud