diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-31 13:48:33 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-31 13:48:33 +0000 |
commit | e1d46407d705bb612ebbeebddbe85779b52a42a5 (patch) | |
tree | b128da7e2130d5eeae1d5918b1cc8692523d852b /sys/miscfs/fifofs/fifo_vnops.c | |
parent | a2985aa5fb51f9899868daaf2cde0dfa5a0f449f (diff) |
Use C99 designated initializers with struct filterops. In addition,
make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
Diffstat (limited to 'sys/miscfs/fifofs/fifo_vnops.c')
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 947badf3a91..d71b917214f 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.69 2019/12/12 16:33:02 visa Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.70 2019/12/31 13:48:32 visa Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -107,10 +107,19 @@ int filt_fiforead(struct knote *kn, long hint); void filt_fifowdetach(struct knote *kn); int filt_fifowrite(struct knote *kn, long hint); -struct filterops fiforead_filtops = - { 1, NULL, filt_fifordetach, filt_fiforead }; -struct filterops fifowrite_filtops = - { 1, NULL, filt_fifowdetach, filt_fifowrite }; +const struct filterops fiforead_filtops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = filt_fifordetach, + .f_event = filt_fiforead, +}; + +const struct filterops fifowrite_filtops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = filt_fifowdetach, + .f_event = filt_fifowrite, +}; /* * Open called to set up a new instance of a fifo or |