summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Písař <ppisar@redhat.com>2013-10-16 14:55:18 +0200
committerJan Kara <jack@suse.cz>2013-10-29 23:29:52 +0100
commit23801eb4fc88904256303728279cf4cc3c721f6d (patch)
tree76b0d25a71611fef197a165985190f8d81eb59a0
parenta58761459f7485f275ecca5fd26b9a63c33f1089 (diff)
downloadquota-tools-23801eb4fc88904256303728279cf4cc3c721f6d.tar.gz
Silent a set-but-not-used warning about sbflags
If XFS_ROOTHACK is not defined, sbflags gets set but never used. This patch declares the variable only if needed. Signed-off-by: Petr Písař <ppisar@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--quotasys.c5
-rw-r--r--repquota.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/quotasys.c b/quotasys.c
index a1ac392..dee5118 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -487,7 +487,6 @@ const char *str2number(const char *string, qsize_t *inodes)
*/
static int hasxfsquota(const char *dev, struct mntent *mnt, int type, int flags)
{
- u_int16_t sbflags;
struct xfs_mem_dqinfo info;
if (flags & MS_XFS_DISABLED)
@@ -495,7 +494,9 @@ static int hasxfsquota(const char *dev, struct mntent *mnt, int type, int flags)
memset(&info, 0, sizeof(struct xfs_mem_dqinfo));
if (!quotactl(QCMD(Q_XFS_GETQSTAT, type), dev, 0, (void *)&info)) {
- sbflags = (info.qs_flags & 0xff00) >> 8;
+#ifdef XFS_ROOTHACK
+ int sbflags = (info.qs_flags & 0xff00) >> 8;
+#endif /* XFS_ROOTHACK */
if (type == USRQUOTA && (info.qs_flags & XFS_QUOTA_UDQ_ACCT))
return QF_XFS;
else if (type == GRPQUOTA && (info.qs_flags & XFS_QUOTA_GDQ_ACCT))
diff --git a/repquota.c b/repquota.c
index db4f6da..cce017a 100644
--- a/repquota.c
+++ b/repquota.c
@@ -231,9 +231,9 @@ static void print(struct dquot *dquot, char *name)
char *spacehdr;
if (flags & FL_SHORTNUMS)
- spacehdr = "Space";
+ spacehdr = "space";
else
- spacehdr = "Block";
+ spacehdr = "block";
printf(" <Quota user='%s'>\n\
<QuotaStatus %s='%s' inode='%s' />\n\
@@ -352,7 +352,7 @@ static void report_it(struct quota_handle *h, int type)
if (ofmt == QOF_DEFAULT )
printf(_("*** Report for %s quotas on device %s\n"), _(type2name(type)), h->qh_quotadev);
else if (ofmt == QOF_XML)
- printf("<RepQuota type='%s' dev='%s'>\n", type2name(type), h->qh_quotadev);
+ printf("<Report type='%s' dev='%s'>\n", type2name(type), h->qh_quotadev);
time2str(h->qh_info.dqi_bgrace, bgbuf, TF_ROUND);
time2str(h->qh_info.dqi_igrace, igbuf, TF_ROUND);
@@ -386,7 +386,7 @@ static void report_it(struct quota_handle *h, int type)
putchar('\n');
}
if (ofmt == QOF_XML)
- printf("</RepQuota>\n");
+ printf("</Report>\n");
}
static void report(int type)
@@ -412,7 +412,7 @@ int main(int argc, char **argv)
init_kernel_interface();
if (ofmt == QOF_XML)
- printf("<?xml version=\"1.0\"?>\n");
+ printf("<?xml version=\"1.0\"?>\n<repquota>\n");
if (flags & FL_USER)
report(USRQUOTA);
@@ -420,5 +420,8 @@ int main(int argc, char **argv)
if (flags & FL_GROUP)
report(GRPQUOTA);
+ if (ofmt == QOF_XML)
+ printf("</repquota>\n");
+
return 0;
}