Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2009 17:50:28 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r198299 - projects/quota64/usr.sbin/repquota
Message-ID:  <200910201750.n9KHoSYi073773@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Tue Oct 20 17:50:27 2009
New Revision: 198299
URL: http://svn.freebsd.org/changeset/base/198299

Log:
  Claen up format when doing non-humanized output.

Modified:
  projects/quota64/usr.sbin/repquota/repquota.c

Modified: projects/quota64/usr.sbin/repquota/repquota.c
==============================================================================
--- projects/quota64/usr.sbin/repquota/repquota.c	Tue Oct 20 17:44:50 2009	(r198298)
+++ projects/quota64/usr.sbin/repquota/repquota.c	Tue Oct 20 17:50:27 2009	(r198299)
@@ -208,6 +208,7 @@ repquota(struct fstab *fs, int type)
 				printf("\n");
 			fprintf(stdout, "*** No %s quotas on %s (%s)\n",
 			    qfextension[type], fs->fs_file, fs->fs_spec);
+			return(1);
 		}
 		return(0);
 	}
@@ -221,7 +222,7 @@ repquota(struct fstab *fs, int type)
 	printf("User%*s  used   soft   hard  grace     used    soft    hard  grace\n",
 		max(UT_NAMESIZE,10), " ");
 	maxid = quota_maxid(qf);
-	for (id = 0; id <= maxid; id++) {
+	for (id = 0; id < maxid; id++) {
 		if (quota_read(qf, &dqbuf, id) != 0)
 			break;
 		if (dqbuf.dqb_curinodes == 0 && dqbuf.dqb_curblocks == 0)
@@ -253,6 +254,7 @@ repquota(struct fstab *fs, int type)
 			    dqbuf.dqb_isoftlimit ?
 			    timeprt(dqbuf.dqb_itime) : "-");
 	}
+	quota_close(qf);
 	return (0);
 }
 
@@ -263,7 +265,7 @@ prthumanval(int64_t blocks)
 	int flags;
 
 	if (!hflag) {
-		printf("%7llu", dbtokb(blocks));
+		printf(" %6llu", dbtokb(blocks));
 		return;
 	}
 	flags = HN_NOSPACE | HN_DECIMAL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910201750.n9KHoSYi073773>