summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-04-10 09:17:46 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-04-10 09:17:46 +0000
commitf70f94eabd63dfc3141ba36d9aa0e6e343c2d51a (patch)
tree267a4d5e100e39b685ea83eefab371aa8a2c176f /sys/kern
parent785625a1e62daf057e9a0d41de3f5b0a2f32663c (diff)
Convert 'struct fileops' definitions to C99.
ok millert@, deraadt@, florian@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_event.c16
-rw-r--r--sys/kern/sys_pipe.c11
-rw-r--r--sys/kern/sys_socket.c11
-rw-r--r--sys/kern/vfs_vnops.c14
4 files changed, 34 insertions, 18 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index b9ec18e07e8..0fbef3a4271 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.86 2018/04/08 16:45:12 mikeb Exp $ */
+/* $OpenBSD: kern_event.c,v 1.87 2018/04/10 09:17:45 mpi Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -71,13 +71,13 @@ int kqueue_close(struct file *fp, struct proc *p);
void kqueue_wakeup(struct kqueue *kq);
struct fileops kqueueops = {
- kqueue_read,
- kqueue_write,
- kqueue_ioctl,
- kqueue_poll,
- kqueue_kqfilter,
- kqueue_stat,
- kqueue_close
+ .fo_read = kqueue_read,
+ .fo_write = kqueue_write,
+ .fo_ioctl = kqueue_ioctl,
+ .fo_poll = kqueue_poll,
+ .fo_kqfilter = kqueue_kqfilter,
+ .fo_stat = kqueue_stat,
+ .fo_close = kqueue_close
};
void knote_attach(struct knote *kn, struct filedesc *fdp);
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 439eec218e0..c0655cdda67 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_pipe.c,v 1.77 2018/01/02 06:38:45 guenther Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.78 2018/04/10 09:17:45 mpi Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
@@ -61,8 +61,13 @@ int pipe_ioctl(struct file *, u_long, caddr_t, struct proc *);
int pipe_stat(struct file *fp, struct stat *ub, struct proc *p);
static struct fileops pipeops = {
- pipe_read, pipe_write, pipe_ioctl, pipe_poll, pipe_kqfilter,
- pipe_stat, pipe_close
+ .fo_read = pipe_read,
+ .fo_write = pipe_write,
+ .fo_ioctl = pipe_ioctl,
+ .fo_poll = pipe_poll,
+ .fo_kqfilter = pipe_kqfilter,
+ .fo_stat = pipe_stat,
+ .fo_close = pipe_close
};
void filt_pipedetach(struct knote *kn);
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index e070acce938..7e861d8e2d0 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_socket.c,v 1.35 2017/12/10 11:31:54 mpi Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.36 2018/04/10 09:17:45 mpi Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
@@ -48,8 +48,13 @@
#include <net/route.h>
struct fileops socketops = {
- soo_read, soo_write, soo_ioctl, soo_poll, soo_kqfilter,
- soo_stat, soo_close
+ .fo_read = soo_read,
+ .fo_write = soo_write,
+ .fo_ioctl = soo_ioctl,
+ .fo_poll = soo_poll,
+ .fo_kqfilter = soo_kqfilter,
+ .fo_stat = soo_stat,
+ .fo_close = soo_close
};
int
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 1c265465129..c05cff1908f 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.89 2018/01/02 06:38:45 guenther Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.90 2018/04/10 09:17:45 mpi Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -65,9 +65,15 @@ int vn_poll(struct file *, int, struct proc *);
int vn_kqfilter(struct file *, struct knote *);
int vn_closefile(struct file *, struct proc *);
-struct fileops vnops =
- { vn_read, vn_write, vn_ioctl, vn_poll, vn_kqfilter, vn_statfile,
- vn_closefile };
+struct fileops vnops = {
+ .fo_read = vn_read,
+ .fo_write = vn_write,
+ .fo_ioctl = vn_ioctl,
+ .fo_poll = vn_poll,
+ .fo_kqfilter = vn_kqfilter,
+ .fo_stat = vn_statfile,
+ .fo_close = vn_closefile
+};
/*
* Common code for vnode open operations.