]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_fsr: Fix parentheses around truth value
authorEric Sandeen <sandeen@redhat.com>
Tue, 18 Aug 2015 07:53:17 +0000 (17:53 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 18 Aug 2015 07:53:17 +0000 (17:53 +1000)
commit98166c91f092fe8a0c41244583e84a080e1f1858
tree4b4c3805f153965e53ca9991580e26e51e3c9475
parentbfbb770243190c15cd4223c14b92aae15ebb9198
xfs_fsr: Fix parentheses around truth value

Someone in the distant past must have responded to gcc's
warning about parentheses around assignment used as a truth
value by changing:

while (ret = func() == 0)
to:
while ((ret = func() == 0))

While this shuts up gcc, it doesn't yield the proper result.
If func () returns 0, func == 0 is true, and ret is assigned
a value of 1.

This does keep the while loop going, but it's a very strange
way to go about it, and may someday yield confusing results.

Fix this as:

while ((ret = func()) == 0)

so that ret gets the function return value as expected.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fsr/xfs_fsr.c