aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index bc0725230cca..8cf5ffcdbb96 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -90,6 +90,7 @@ static fo_poll_t soo_poll;
static fo_kqfilter_t soo_kqfilter;
static fo_stat_t soo_stat;
static fo_close_t soo_close;
+static fo_fdclose_t soo_fdclose;
static fo_chmod_t soo_chmod;
static fo_fill_kinfo_t soo_fill_kinfo;
static fo_aio_queue_t soo_aio_queue;
@@ -105,6 +106,7 @@ const struct fileops socketops = {
.fo_kqfilter = soo_kqfilter,
.fo_stat = soo_stat,
.fo_close = soo_close,
+ .fo_fdclose = soo_fdclose,
.fo_chmod = soo_chmod,
.fo_chown = invfo_chown,
.fo_sendfile = invfo_sendfile,
@@ -362,6 +364,16 @@ soo_close(struct file *fp, struct thread *td)
return (error);
}
+static void
+soo_fdclose(struct file *fp, int fd __unused, struct thread *td)
+{
+ struct socket *so;
+
+ so = fp->f_data;
+ if (so->so_proto->pr_fdclose != NULL)
+ so->so_proto->pr_fdclose(so);
+}
+
static int
soo_chmod(struct file *fp, mode_t mode, struct ucred *cred, struct thread *td)
{