From 2554243d8872a5083ad2bbd019e2e513000df3c6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 6 Jan 2016 08:38:46 -0800 Subject: Fix directory test in cp. Commit 3d33dd80f8cb931e293d7f64c44bc357fec11120 fixed a use of S_ISDIR on st_dev rather than st_mode in find, but there was another instance of the same error in cp. --- toys/posix/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/cp.c b/toys/posix/cp.c index f932ca4f..cb7e6e3b 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -177,7 +177,7 @@ int cp_node(struct dirtree *try) if (!faccessat(cfd, catch, F_OK, 0) && !S_ISDIR(cst.st_mode)) { char *s; - if (S_ISDIR(try->st.st_dev)) { + if (S_ISDIR(try->st.st_mode)) { error_msg("dir at '%s'", s = dirtree_path(try, 0)); free(s); return 0; -- cgit v1.2.3