From: nekral-guest Date: Fri, 28 Dec 2007 00:08:16 +0000 (+0000) Subject: Stop at the first error. X-Git-Tag: 4.1.1~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=523392dc0b4ec8705f7f1b3ef1ff9abd418898b6;p=shadow Stop at the first error. --- 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