Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/repquota Make sure to not report quotas for a class...



details:   https://anonhg.NetBSD.org/src/rev/d8c4cff8aef3
branches:  trunk
changeset: 763610:d8c4cff8aef3
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Mar 27 17:15:17 2011 +0000

description:
Make sure to not report quotas for a class if we didn't get valid datas
from kernel.

diffstat:

 usr.sbin/repquota/repquota.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 38113cf80fb5 -r d8c4cff8aef3 usr.sbin/repquota/repquota.c
--- a/usr.sbin/repquota/repquota.c      Sun Mar 27 16:45:15 2011 +0000
+++ b/usr.sbin/repquota/repquota.c      Sun Mar 27 17:15:17 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: repquota.c,v 1.30 2011/03/24 17:05:47 bouyer Exp $     */
+/*     $NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $     */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)repquota.c 8.2 (Berkeley) 11/22/94";
 #else
-__RCSID("$NetBSD: repquota.c,v 1.30 2011/03/24 17:05:47 bouyer Exp $");
+__RCSID("$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -284,8 +284,9 @@
                if (dataiter == NULL)
                        err(1, "prop_array_iterator");
 
-               valid[class] = 1;
+               valid[class] = 0;
                while ((data = prop_object_iterator_next(dataiter)) != NULL) {
+                       valid[class] = 1;
                        strid = NULL;
                        if (!prop_dictionary_get_uint32(data, "id", &id)) {
                                if (!prop_dictionary_get_cstring_nocopy(data,
@@ -317,7 +318,7 @@
        }
        prop_object_iterator_release(cmditer);
        prop_object_release(dict);
-       if (xflag == 0)
+       if (xflag == 0 && valid[class])
                printquotas(class, vfs, version);
        return 0;
 }



Home | Main Index | Thread Index | Old Index