summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2012-06-20 17:30:23 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2012-06-20 17:30:23 +0000
commite3751797b5afd2a18ab6175ce166111383bf99b5 (patch)
treef8cbc586974f22efee2e9aa738f3f6e29044aa3f /sys/miscfs
parent159f5470d216e7cd95c64dc10d61be4b3eab2ac2 (diff)
Cleanup our filesystem pathconf() code a little bit to make it easier
to diff against FreeBSD's. From Brad; no object file change on amd64.
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fifofs/fifo_vnops.c15
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c21
2 files changed, 21 insertions, 15 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c
index 2edeaaf0ba6..cb73bdd09fa 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.36 2011/07/02 22:20:08 nicm Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.37 2012/06/20 17:30:22 matthew Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
@@ -408,21 +408,24 @@ int
fifo_pathconf(void *v)
{
struct vop_pathconf_args *ap = v;
+ int error = 0;
switch (ap->a_name) {
case _PC_LINK_MAX:
*ap->a_retval = LINK_MAX;
- return (0);
+ break;
case _PC_PIPE_BUF:
*ap->a_retval = PIPE_BUF;
- return (0);
+ break;
case _PC_CHOWN_RESTRICTED:
*ap->a_retval = 1;
- return (0);
+ break;
default:
- return (EINVAL);
+ error = EINVAL;
+ break;
}
- /* NOTREACHED */
+
+ return (error);
}
/*
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index be897b61490..45939b1b234 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_vnops.c,v 1.54 2012/02/20 22:23:39 guenther Exp $ */
+/* $OpenBSD: procfs_vnops.c,v 1.55 2012/06/20 17:30:22 matthew Exp $ */
/* $NetBSD: procfs_vnops.c,v 1.40 1996/03/16 23:52:55 christos Exp $ */
/*
@@ -314,30 +314,33 @@ int
procfs_pathconf(void *v)
{
struct vop_pathconf_args *ap = v;
+ int error = 0;
switch (ap->a_name) {
case _PC_LINK_MAX:
*ap->a_retval = LINK_MAX;
- return (0);
+ break;
case _PC_MAX_CANON:
*ap->a_retval = MAX_CANON;
- return (0);
+ break;
case _PC_MAX_INPUT:
*ap->a_retval = MAX_INPUT;
- return (0);
+ break;
case _PC_PIPE_BUF:
*ap->a_retval = PIPE_BUF;
- return (0);
+ break;
case _PC_CHOWN_RESTRICTED:
*ap->a_retval = 1;
- return (0);
+ break;
case _PC_VDISABLE:
*ap->a_retval = _POSIX_VDISABLE;
- return (0);
+ break;
default:
- return (EINVAL);
+ error = EINVAL;
+ break;
}
- /* NOTREACHED */
+
+ return (error);
}
/*