Indroduce fd_getfile_mode() and use it were fd_getfile() is directly
authormpi <mpi@openbsd.org>
Thu, 30 Apr 2015 09:20:51 +0000 (09:20 +0000)
committermpi <mpi@openbsd.org>
Thu, 30 Apr 2015 09:20:51 +0000 (09:20 +0000)
commitd6bcf78bdbc99f5411dcde1163b12ff573f66ca9
tree72cf7b77446f3c974d397b9f40465b599f432e3e
parent55ef8bd273bd34a50e138476b37c99cdc7e0fa1d
Indroduce fd_getfile_mode() and use it were fd_getfile() is directly
followed by a mode check.  This will simplify the ref/unref dance as
soon as fd_getfile() will increment fp's reference counter.

Idea from and ok guenther@, ok millert@
sys/compat/linux/linux_cdrom.c
sys/compat/linux/linux_termios.c
sys/kern/kern_descrip.c
sys/kern/sys_generic.c
sys/kern/vfs_syscalls.c
sys/sys/filedesc.h