summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 28ef6de78ee..c25ad2915ca 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.42 2001/09/20 17:02:31 mpech Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.43 2001/10/26 12:03:27 art Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -91,6 +91,7 @@ sys_socket(p, v, retval)
ffree(fp);
} else {
fp->f_data = (caddr_t)so;
+ FILE_SET_MATURE(fp);
*retval = fd;
}
return (error);
@@ -230,6 +231,7 @@ sys_accept(p, v, retval)
}
m_freem(nam);
splx(s);
+ FILE_SET_MATURE(fp);
return (error);
}
@@ -336,6 +338,8 @@ sys_socketpair(p, v, retval)
}
error = copyout((caddr_t)sv, (caddr_t)SCARG(uap, rsv),
2 * sizeof (int));
+ FILE_SET_MATURE(fp1);
+ FILE_SET_MATURE(fp2);
if (error == 0)
return (error);
free4:
@@ -1075,8 +1079,7 @@ getsock(fdp, fdes, fpp)
{
register struct file *fp;
- if ((unsigned)fdes >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[fdes]) == NULL)
+ if ((fp = fd_getfile(fdp, fdes)) == NULL)
return (EBADF);
if (fp->f_type != DTYPE_SOCKET)
return (ENOTSOCK);