summaryrefslogtreecommitdiff
path: root/restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'restore.c')
-rw-r--r--restore.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/restore.c b/restore.c
index d1ac5420..b9e5381f 100644
--- a/restore.c
+++ b/restore.c
@@ -385,7 +385,6 @@ static int copy_file(struct btrfs_root *root, int fd, struct btrfs_key *key,
/* No more leaves to search */
btrfs_free_path(path);
goto set_size;
- return 0;
}
leaf = path->nodes[0];
} while (!leaf);
@@ -431,8 +430,11 @@ next:
btrfs_free_path(path);
set_size:
- if (found_size)
- ftruncate(fd, (loff_t)found_size);
+ if (found_size) {
+ ret = ftruncate(fd, (loff_t)found_size);
+ if (ret)
+ return ret;
+ }
return 0;
}