diff options
author | David Sterba <dsterba@suse.com> | 2016-01-12 11:20:18 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-01-12 15:02:55 +0100 |
commit | 633dc6f80f201afdf5b8524ae377187d58f0ef3b (patch) | |
tree | ca5b6375fb6910ac51eea8b89173c45390ce0355 /btrfs-show-super.c | |
parent | 374d67fdef869d2e2dfb9907d21c85ee6c19e1d7 (diff) |
btrfs-progs: remove unnecessary errno temp variables
We can read errno directly if it's not clobbered by any intermediate
calls.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-show-super.c')
-rw-r--r-- | btrfs-show-super.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/btrfs-show-super.c b/btrfs-show-super.c index f1170153..051bd115 100644 --- a/btrfs-show-super.c +++ b/btrfs-show-super.c @@ -144,17 +144,15 @@ static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr, int full, ret = pread64(fd, super_block_data, BTRFS_SUPER_INFO_SIZE, sb_bytenr); if (ret != BTRFS_SUPER_INFO_SIZE) { - int e = errno; - /* check if the disk if too short for further superblock */ - if (ret == 0 && e == 0) + if (ret == 0 && errno == 0) return 0; fprintf(stderr, "ERROR: Failed to read the superblock on %s at %llu\n", filename, (unsigned long long)sb_bytenr); fprintf(stderr, - "ERROR: error = '%s', errno = %d\n", strerror(e), e); + "ERROR: error = '%s', errno = %d\n", strerror(errno), errno); return 1; } printf("superblock: bytenr=%llu, device=%s\n", sb_bytenr, filename); |