char *dest_dir_full_path;
char root_subvol_path[PATH_MAX];
int end = 0;
- int count;
+ int iterations = 0;
dest_dir_full_path = realpath(tomnt, NULL);
if (!dest_dir_full_path) {
if (ret < 0)
goto out;
- count = 0;
while (!end) {
if (rctx->cached_capabilities_len) {
if (g_verbose >= 3)
rctx,
rctx->honor_end_cmd,
max_errors);
- if (ret < 0)
- goto out;
- /* Empty stream is invalid */
- if (ret && count == 0) {
- error("empty stream is not considered valid");
- ret = -EINVAL;
- goto out;
+ if (ret < 0) {
+ if (ret != -ENODATA)
+ goto out;
+
+ /* Empty stream is invalid */
+ if (iterations == 0) {
+ error("empty stream is not considered valid");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ ret = 1;
}
- count++;
- if (ret)
+ if (ret > 0)
end = 1;
close_inode_for_write(rctx);
ret = finish_subvol(rctx);
if (ret < 0)
goto out;
+
+ iterations++;
}
ret = 0;
{ NULL, 0, NULL, 0 }
};
- c = getopt_long(argc, argv, "Cevf:m:", long_opts, NULL);
+ c = getopt_long(argc, argv, "Cevf:m:E:", long_opts, NULL);
if (c < 0)
break;