summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2008-12-30 15:37:31 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2008-12-30 15:37:31 +0000
commit839fa99fca3051bfafcc46193ddddf71e4ca5b09 (patch)
treee942471690f0bba04fabf7e11107dd89a5ada68c /bin
parentda17a1d5b0b664bae2047b69a0c751e5440e622b (diff)
add a comment explaining the rather obscure decision when to recurse
or not; ok millert@ pedro@
Diffstat (limited to 'bin')
-rw-r--r--bin/ls/ls.c8
1 files changed, 6 insertions, 2 deletions
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;