diff options
author | 2001-05-14 13:28:20 +0000 | |
---|---|---|
committer | 2001-05-14 13:28:20 +0000 | |
commit | 72f98858e8e22dc4c686cc94140648bc59df9242 (patch) | |
tree | 4e41dafcd8a9a22b70bc88b504bc05361825e987 /sys/compat/netbsd/netbsd_stat.c | |
parent | Import of krb4-1.0.8. (diff) | |
download | wireguard-openbsd-72f98858e8e22dc4c686cc94140648bc59df9242.tar.xz wireguard-openbsd-72f98858e8e22dc4c686cc94140648bc59df9242.zip |
use fo_stat in fileops instead of huge switch statements.
Diffstat (limited to 'sys/compat/netbsd/netbsd_stat.c')
-rw-r--r-- | sys/compat/netbsd/netbsd_stat.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/sys/compat/netbsd/netbsd_stat.c b/sys/compat/netbsd/netbsd_stat.c index a3735bf6a20..e8a82fe9210 100644 --- a/sys/compat/netbsd/netbsd_stat.c +++ b/sys/compat/netbsd/netbsd_stat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netbsd_stat.c,v 1.9 2001/05/14 12:11:53 art Exp $ */ +/* $OpenBSD: netbsd_stat.c,v 1.10 2001/05/14 13:28:22 art Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -195,26 +195,8 @@ netbsd_sys___fstat13(p, v, retval) if ((u_int)fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) return (EBADF); - switch (fp->f_type) { - case DTYPE_VNODE: - error = vn_statfile(fp, &sb, p); - break; - - case DTYPE_SOCKET: - error = soo_stat(fp, &sb, p); - break; - -#ifndef OLD_PIPE - case DTYPE_PIPE: - error = pipe_stat(fp, &sb, p); - break; -#endif - - default: - panic("netbsd_sys___fstat13"); - /*NOTREACHED*/ - } + error = (*fp->f_ops->fo_stat)(fp, &ub, p); if (error) return (error); openbsd_to_netbsd_stat(&sb, &nsb); |