From 523392dc0b4ec8705f7f1b3ef1ff9abd418898b6 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Fri, 28 Dec 2007 00:08:16 +0000 Subject: [PATCH] Stop at the first error. --- libmisc/copydir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmisc/copydir.c b/libmisc/copydir.c index 1a93a93f..16c80e29 100644 --- a/libmisc/copydir.c +++ b/libmisc/copydir.c @@ -217,7 +217,7 @@ int copy_tree (const char *src_root, const char *dst_root, uid_t uid, gid_t gid) dst_orig = dst_root; set_orig++; } - while ((ent = readdir (dir))) { + while ((0 == err) && (ent = readdir (dir)) != NULL) { /* * Skip the "." and ".." entries