Module Name: src
Committed By: pooka
Date: Fri Jul 31 14:56:11 UTC 2009
Modified Files:
src/sbin/mount_fdesc: mount_fdesc.c
Log Message:
Shortcircuit -o getargs in userspace. We know the kernel driver
will not return any data and mount(2) fails with EINVAL if data_len
is 0. This caused lame-o output in mount -vv:
mount_fdesc: fdesc on /failsystem: Invalid argument
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sbin/mount_fdesc/mount_fdesc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/mount_fdesc/mount_fdesc.c
diff -u src/sbin/mount_fdesc/mount_fdesc.c:1.22 src/sbin/mount_fdesc/mount_fdesc.c:1.23
--- src/sbin/mount_fdesc/mount_fdesc.c:1.22 Sun Jul 20 01:20:22 2008
+++ src/sbin/mount_fdesc/mount_fdesc.c Fri Jul 31 14:56:11 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: mount_fdesc.c,v 1.22 2008/07/20 01:20:22 lukem Exp $ */
+/* $NetBSD: mount_fdesc.c,v 1.23 2009/07/31 14:56:11 pooka Exp $ */
/*
* Copyright (c) 1992, 1993, 1994
@@ -77,7 +77,7 @@
#if 0
static char sccsid[] = "@(#)mount_fdesc.c 8.3 (Berkeley) 4/26/95";
#else
-__RCSID("$NetBSD: mount_fdesc.c,v 1.22 2008/07/20 01:20:22 lukem Exp $");
+__RCSID("$NetBSD: mount_fdesc.c,v 1.23 2009/07/31 14:56:11 pooka Exp $");
#endif
#endif /* not lint */
@@ -135,6 +135,10 @@
if (argc != 2)
usage();
+ /* getargs is a NULL op and kernel would return EINVAL */
+ if (mntflags & MNT_GETARGS)
+ exit(0);
+
if (realpath(argv[1], canon_dir) == NULL) /* Check mounton path */
err(1, "realpath %s", argv[1]);
if (strncmp(argv[1], canon_dir, MAXPATHLEN)) {