Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/librumphijack Close all file descriptors before tr...



details:   https://anonhg.NetBSD.org/src/rev/8c12f8641dc0
branches:  trunk
changeset: 778916:8c12f8641dc0
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Apr 20 05:15:11 2012 +0000

description:
Close all file descriptors before trying to reason about the number of open
descriptors. Should fix the test failures reported on current users.

diffstat:

 tests/lib/librumphijack/h_client.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 67133836dc76 -r 8c12f8641dc0 tests/lib/librumphijack/h_client.c
--- a/tests/lib/librumphijack/h_client.c        Fri Apr 20 02:07:43 2012 +0000
+++ b/tests/lib/librumphijack/h_client.c        Fri Apr 20 05:15:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_client.c,v 1.7 2012/04/17 09:23:21 jruoho Exp $      */
+/*     $NetBSD: h_client.c,v 1.8 2012/04/20 05:15:11 jruoho Exp $      */
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -115,12 +115,15 @@
 
                return EXIT_SUCCESS;
        } else if (strcmp(argv[1], "fdoff8") == 0) {
+
+               (void)closefrom(0);
+
                int fd;
 
-               do
+               do {
                        if ((fd = open("/dev/null", O_RDWR)) == -1)
                                err(EXIT_FAILURE, "open1");
-               while (fd < 7);
+               } while (fd < 7);
                fd = open("/dev/null", O_RDWR);
                if (fd != -1 || errno != ENFILE)
                        errx(EXIT_FAILURE, "unexpected fd8 %d %d", fd, errno);



Home | Main Index | Thread Index | Old Index