summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-01-17 16:36:48 -0800
committerZach Brown <zab@redhat.com>2013-02-05 16:09:38 -0800
commitba4791fde3495c04648038c7376f21bd7b3298a6 (patch)
tree55e393dbb627eef7e13e581bdf6fa85c92e0a42b
parentd86394da233c4305fb72daf72914cbb193373e1d (diff)
btrfs-progs: fix copy-n-paste error checking
copy_one_inline() meant to test the return of pwrite() with ram_size. Presumably the comparison with len was copied from the test earlier in the function. Signed-off-by: Zach Brown <zab@redhat.com>
-rw-r--r--restore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/restore.c b/restore.c
index 80afb843..ecabc3e2 100644
--- a/restore.c
+++ b/restore.c
@@ -173,7 +173,7 @@ static int copy_one_inline(int fd, struct btrfs_path *path, u64 pos)
done = pwrite(fd, outbuf, ram_size, pos);
free(outbuf);
- if (done < len) {
+ if (done < ram_size) {
fprintf(stderr, "Short compressed inline write, wanted %d, "
"did %zd: %d\n", ram_size, done, errno);
return -1;