Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/syscall Do not fail if readdir(3) fails, probably due ...



details:   https://anonhg.NetBSD.org/src/rev/8cc1c8bfd3b0
branches:  trunk
changeset: 765745:8cc1c8bfd3b0
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Jun 04 15:45:55 2011 +0000

description:
Do not fail if readdir(3) fails, probably due fts(3).

diffstat:

 tests/syscall/t_stat.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r ab71be5cfa6c -r 8cc1c8bfd3b0 tests/syscall/t_stat.c
--- a/tests/syscall/t_stat.c    Sat Jun 04 15:45:41 2011 +0000
+++ b/tests/syscall/t_stat.c    Sat Jun 04 15:45:55 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_stat.c,v 1.1 2011/06/04 09:29:44 jruoho Exp $ */
+/* $NetBSD: t_stat.c,v 1.2 2011/06/04 15:45:55 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_stat.c,v 1.1 2011/06/04 09:29:44 jruoho Exp $");
+__RCSID("$NetBSD: t_stat.c,v 1.2 2011/06/04 15:45:55 jruoho Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -147,7 +147,9 @@
                        ATF_REQUIRE(dir != NULL);
 
                        dr = readdir(dir);
-                       ATF_REQUIRE(dr != NULL);
+
+                       if (dr == NULL)
+                               break;
 
                        if (sb.st_ino != dr->d_fileno)
                                atf_tc_fail("stat(2) and readdir(3) differ");



Home | Main Index | Thread Index | Old Index