From 839fa99fca3051bfafcc46193ddddf71e4ca5b09 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 30 Dec 2008 15:37:31 +0000 Subject: add a comment explaining the rather obscure decision when to recurse or not; ok millert@ pedro@ --- bin/ls/ls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/ls/ls.c b/bin/ls/ls.c index dc7e5323029..136cb073df8 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ls.c,v 1.32 2008/12/29 14:49:27 otto Exp $ */ +/* $OpenBSD: ls.c,v 1.33 2008/12/30 15:37:30 otto Exp $ */ /* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */ /* @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94"; #else -static char rcsid[] = "$OpenBSD: ls.c,v 1.32 2008/12/29 14:49:27 otto Exp $"; +static char rcsid[] = "$OpenBSD: ls.c,v 1.33 2008/12/30 15:37:30 otto Exp $"; #endif #endif /* not lint */ @@ -385,6 +385,10 @@ traverse(int argc, char *argv[], int options) saved_errno = errno; display(p, chp); + /* + * On fts_children() returning error do recurse to see + * the error. + */ if (!f_recursive && !(chp == NULL && saved_errno != 0)) (void)fts_set(ftsp, p, FTS_SKIP); break; -- cgit v1.2.3