diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index 20e9316e8d4..894b9bac333 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -655,8 +655,10 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path) const struct stat *st = NULL, *lst = NULL; int descend; - if (tree_ret == TREE_ERROR_DIR) + if (tree_ret == TREE_ERROR_DIR) { bsdtar_warnc(bsdtar, errno, "%s: Couldn't visit directory", name); + bsdtar->return_value = 1; + } if (tree_ret != TREE_REGULAR) continue; lst = tree_current_lstat(tree);