Module Name: src
Committed By: jruoho
Date: Fri Apr 20 05:15:11 UTC 2012
Modified Files:
src/tests/lib/librumphijack: h_client.c
Log Message:
Close all file descriptors before trying to reason about the number of open
descriptors. Should fix the test failures reported on current users.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/librumphijack/h_client.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/librumphijack/h_client.c
diff -u src/tests/lib/librumphijack/h_client.c:1.7 src/tests/lib/librumphijack/h_client.c:1.8
--- src/tests/lib/librumphijack/h_client.c:1.7 Tue Apr 17 09:23:21 2012
+++ src/tests/lib/librumphijack/h_client.c Fri Apr 20 05:15:11 2012
@@ -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 @@ main(int argc, char *argv[])
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);