Module Name: src
Committed By: dholland
Date: Sun Mar 18 17:09:46 UTC 2012
Modified Files:
src/usr.bin/find: find.c
Log Message:
Avoid testing a possibly uninitialized errno value when using -exit.
Closes PR 44973 (change is a somewhat more principled equivalent of
the patch suggested there) although I cannot replicate the reported
behavior unless I explicitly prepare errno with a nonzero value before
the fts_read loop.
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/find/find.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/find/find.c
diff -u src/usr.bin/find/find.c:1.27 src/usr.bin/find/find.c:1.28
--- src/usr.bin/find/find.c:1.27 Tue Dec 28 15:28:31 2010
+++ src/usr.bin/find/find.c Sun Mar 18 17:09:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: find.c,v 1.27 2010/12/28 15:28:31 christos Exp $ */
+/* $NetBSD: find.c,v 1.28 2012/03/18 17:09:46 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "from: @(#)find.c 8.5 (Berkeley) 8/5/94";
#else
-__RCSID("$NetBSD: find.c,v 1.27 2010/12/28 15:28:31 christos Exp $");
+__RCSID("$NetBSD: find.c,v 1.28 2012/03/18 17:09:46 dholland Exp $");
#endif
#endif /* not lint */
@@ -258,7 +258,7 @@ find_execute(PLAN *plan, char **paths)
}
sig_unlock(&s);
- if (errno)
+ if (g_entry == NULL && errno)
err(1, "fts_read");
(void)fts_close(tree);