summaryrefslogtreecommitdiff
path: root/btrfs-show-super.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-12 11:20:18 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:55 +0100
commit633dc6f80f201afdf5b8524ae377187d58f0ef3b (patch)
treeca5b6375fb6910ac51eea8b89173c45390ce0355 /btrfs-show-super.c
parent374d67fdef869d2e2dfb9907d21c85ee6c19e1d7 (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.c6
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);