Only negatie return values from open mean we failed to open the device.
Without this check we do not print the usage message when no device is
specified. This leads to a weird failure in xfstests 122.
Reviewed-by: Eric Sandeen <sandeen@sandeen.ent>
Signed-off-by: Christoph Hellwig <hch@lst.de>
&ft->dsunit, &ft->dswidth, &ft->sectoralign);
fd = open(dfile, O_RDONLY);
/* If this fails we just fall back to BBSIZE */
- if (fd) {
+ if (fd >= 0) {
platform_findsizes(dfile, fd, &dummy, &bsz);
close(fd);
}