diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index 578c044e5c8..128f2c2c8a7 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -6,7 +6,7 @@ # PROG= bsdtar -VERSION= 1.02.022 +VERSION= 1.02.023 DIST_SRCS= bsdtar.c getdate.y matching.c read.c tree.c util.c write.c SRCS= ${DIST_SRCS} WARNS?= 5 diff --git a/usr.bin/tar/tree.c b/usr.bin/tar/tree.c index 0fc35845239..4528eea3c15 100644 --- a/usr.bin/tar/tree.c +++ b/usr.bin/tar/tree.c @@ -309,13 +309,13 @@ tree_next(struct tree *t) /* chdir() failed; return error */ tree_pop(t); t->tree_errno = errno; - return (t->visit_type = TREE_ERROR); + return (t->visit_type = TREE_ERROR_DIR); } t->d = opendir("."); if (t->d == NULL) { tree_pop(t); t->tree_errno = errno; - return (t->visit_type = TREE_ERROR); + return (t->visit_type = TREE_ERROR_DIR); } t->depth++; t->flags &= ~hasLstat; diff --git a/usr.bin/tar/tree.h b/usr.bin/tar/tree.h index 95dad6b78c5..06eab8ea08f 100644 --- a/usr.bin/tar/tree.h +++ b/usr.bin/tar/tree.h @@ -68,7 +68,7 @@ void tree_close(struct tree *); #define TREE_REGULAR 1 #define TREE_POSTDESCENT 2 #define TREE_POSTASCENT 3 -#define TREE_ERROR -1 +#define TREE_ERROR_DIR -1 int tree_next(struct tree *); int tree_errno(struct tree *); diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index 3d833e93f8d..39743276e9c 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -537,14 +537,14 @@ 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) - bsdtar_warnc(bsdtar, errno, "%s", name); + if (tree_ret == TREE_ERROR_DIR) + bsdtar_warnc(bsdtar, errno, "%s: Couldn't visit directory", name); if (tree_ret != TREE_REGULAR) continue; lst = tree_current_lstat(tree); if (lst == NULL) { /* Couldn't lstat(); must not exist. */ - bsdtar_warnc(bsdtar, errno, "%s: Cannot open", path); + bsdtar_warnc(bsdtar, errno, "%s: Cannot stat", path); bsdtar->return_value = 1; continue; } @@ -744,7 +744,7 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st, fd = open(accpath, O_RDONLY); if (fd < 0) { if (!bsdtar->verbose) - bsdtar_warnc(bsdtar, errno, "%s", pathname); + bsdtar_warnc(bsdtar, errno, "%s: could not open file", pathname); else fprintf(stderr, ": %s", strerror(errno)); goto cleanup;