diff options
author | 2019-12-31 13:48:31 +0000 | |
---|---|---|
committer | 2019-12-31 13:48:31 +0000 | |
commit | 94321eb495589ab239b0671b5b64153695549a6a (patch) | |
tree | efc2ebaf9be368d77ceb76d98681ee04c39c30d9 /sys/kern/tty.c | |
parent | In mrt_dump_hdr_rde() use clock_gettime(CLOCK_REALTIME, ) like it is done (diff) | |
download | wireguard-openbsd-94321eb495589ab239b0671b5b64153695549a6a.tar.xz wireguard-openbsd-94321eb495589ab239b0671b5b64153695549a6a.zip |
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/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index a21f7f2741f..d73714f77d8 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.148 2019/07/19 00:17:15 cheloha Exp $ */ +/* $OpenBSD: tty.c,v 1.149 2019/12/31 13:48:32 visa Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -1062,10 +1062,19 @@ ttpoll(dev_t device, int events, struct proc *p) return (revents); } -struct filterops ttyread_filtops = - { 1, NULL, filt_ttyrdetach, filt_ttyread }; -struct filterops ttywrite_filtops = - { 1, NULL, filt_ttywdetach, filt_ttywrite }; +const struct filterops ttyread_filtops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = filt_ttyrdetach, + .f_event = filt_ttyread, +}; + +const struct filterops ttywrite_filtops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = filt_ttywdetach, + .f_event = filt_ttywrite, +}; int ttkqfilter(dev_t dev, struct knote *kn) |