diff options
author | Petr Písař <ppisar@redhat.com> | 2013-10-16 14:55:18 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2013-10-29 23:29:52 +0100 |
commit | 23801eb4fc88904256303728279cf4cc3c721f6d (patch) | |
tree | 76b0d25a71611fef197a165985190f8d81eb59a0 /quotasys.c | |
parent | a58761459f7485f275ecca5fd26b9a63c33f1089 (diff) |
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>
Diffstat (limited to 'quotasys.c')
-rw-r--r-- | quotasys.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)) |