Whamcloud - gitweb
filefrag: fix issues with 29758d2
authorEric Sandeen <sandeen@redhat.com>
Mon, 2 Jun 2014 01:27:41 +0000 (21:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 2 Jun 2014 01:27:43 +0000 (21:27 -0400)
commitf2ca701c1c5e8000c60c8a8dbae5afad5f500138
tree99d4a2dbdde1a19eea8b458f8a58c34b212a481b
parent1c97e615f3f5269bc89e6aef82b148173f1c598c
filefrag: fix issues with 29758d2

29758d2 filefrag: exit with error code if an error is hit

introduced a couple errors; in one case it missed returning
a value, and possibly picked up errno from (unchecked) close(),
and in the other used a test where it needed an
assignment.  So capture the error, move perror() directly
after the failed call in both cases, and fix the assignment.

Also fix a precedence problem with:

if (fe_flags & mask == 0)

which is equivalent to:

if (fe_flags & (mask == 0))

but we need:

if ((fe_flags & mask) == 0)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
misc/filefrag.c