From 23801eb4fc88904256303728279cf4cc3c721f6d Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Wed, 16 Oct 2013 14:55:18 +0200 Subject: Silent a set-but-not-used warning about sbflags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ř Signed-off-by: Jan Kara --- quotasys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'quotasys.c') 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)) -- cgit v1.2.3