From fec3fd1f8ac1db9ed87b79bd3eb5e38aa835e881 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 26 Jul 2014 13:30:40 -0500 Subject: Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle. --- toys/posix/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/cp.c') diff --git a/toys/posix/cp.c b/toys/posix/cp.c index 283ee978..aecd1870 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -84,7 +84,7 @@ int cp_node(struct dirtree *try) if (!dirtree_notdotdot(try)) return 0; // If returning from COMEAGAIN, jump straight to -p logic at end. - if (S_ISDIR(try->st.st_mode) && try->data == -1) { + if (S_ISDIR(try->st.st_mode) && try->again) { fdout = try->extra; err = 0; } else { -- cgit v1.2.3