mount{,_ufs}: Fix wrong mountctl(2) error check.
authorSascha Wildner <saw@online.de>
Wed, 14 Nov 2012 10:06:26 +0000 (11:06 +0100)
committerSascha Wildner <saw@online.de>
Wed, 14 Nov 2012 10:07:37 +0000 (11:07 +0100)
mountctl(2) returns the number of copied bytes when successful, and -1
if there was an error. This prevented ", local" from being printed in
mount output.

Reported-by: YONETANI Tomokazu
sbin/mount/mount.c
sbin/mount_ufs/mount.c

index 36b6cd4..6cb190e 100644 (file)
@@ -508,7 +508,7 @@ prmount(struct statfs *sfp)
                        printf("%d", sfp->f_owner);
        }
 
-       if (error == 0 && strlen(buf))
+       if (error != -1 && strlen(buf))
                printf(", %s", buf);
 
        if (verbose) {
index 2005f28..0b6186f 100644 (file)
@@ -497,7 +497,7 @@ prmount(struct statfs *sfp)
                        printf("%d", sfp->f_owner);
        }
 
-       if (error == 0 && strlen(buf))
+       if (error != -1 && strlen(buf))
                printf(", %s", buf);
 
        if (verbose) {