From: Sascha Wildner Date: Sat, 20 Oct 2012 08:18:27 +0000 (+0200) Subject: mount{,_ufs}(8): Check for mountctl() error before printing buf. X-Git-Tag: v3.4.0rc~990^2~29 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/199559e75f406267e7222e62afdba6580f00005e mount{,_ufs}(8): Check for mountctl() error before printing buf. --- diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 91153c7a03..36b6cd4c2b 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -484,7 +484,7 @@ prmount(struct statfs *sfp) { struct passwd *pw; char *buf; - int __unused error; + int error; int len; error = 0; @@ -508,7 +508,7 @@ prmount(struct statfs *sfp) printf("%d", sfp->f_owner); } - if (strlen(buf)) + if (error == 0 && strlen(buf)) printf(", %s", buf); if (verbose) { diff --git a/sbin/mount_ufs/mount.c b/sbin/mount_ufs/mount.c index affe955bf8..2005f28313 100644 --- a/sbin/mount_ufs/mount.c +++ b/sbin/mount_ufs/mount.c @@ -33,7 +33,6 @@ * @(#) Copyright (c) 1980, 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount.c 8.25 (Berkeley) 5/8/95 * $FreeBSD: src/sbin/mount/mount.c,v 1.39.2.3 2001/08/01 08:26:23 obrien Exp $ - * $DragonFly: src/sbin/mount/mount.c,v 1.10 2005/04/03 17:13:08 joerg Exp $ */ #include @@ -474,7 +473,7 @@ prmount(struct statfs *sfp) { struct passwd *pw; char *buf; - int __unused error; + int error; int len; error = 0; @@ -498,7 +497,7 @@ prmount(struct statfs *sfp) printf("%d", sfp->f_owner); } - if (strlen(buf)) + if (error == 0 && strlen(buf)) printf(", %s", buf); if (verbose) {