> > one test -- test-dup2 -- recently added to the findutils test suite > > is inherently broken and may fail. > > Thanks for the report. > Rather than removing the test, let's fix it by closing the next > two fd's. It should be an easy enough fix, but I don't have > commit access right now or I would do it.
Now that I'm back from vacation, here's what I will be committing: From: Eric Blake <e...@byu.net> Date: Thu, 13 Aug 2009 12:11:47 -0600 Subject: [PATCH] test-dup2: fix bad assumption * tests/test-dup2.c (main): Tolerate leaked fds from environment. Reported by Peter Breitenlohner <p...@mppmu.mpg.de>. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 6 ++++++ tests/test-dup2.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fb3750..1e82039 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ 2009-08-13 Eric Blake <e...@byu.net> + + test-dup2: fix bad assumption + * tests/test-dup2.c (main): Tolerate leaked fds from environment. + Reported by Peter Breitenlohner <p...@mppmu.mpg.de>. + +2009-08-13 Eric Blake <e...@byu.net> and Bruno Haible <br...@clisp.org> stddef: fix NetBSD 5.0 NULL bug, rather than working around it diff --git a/tests/test-dup2.c b/tests/test-dup2.c index 67f49ef..2009aaa 100644 --- a/tests/test-dup2.c +++ b/tests/test-dup2.c @@ -67,8 +67,12 @@ main () char buffer[1]; int fd = open (file, O_CREAT | O_RDWR, 0600); - ASSERT (0 <= fd); + /* Assume std descriptors were provided by invoker. */ + ASSERT (STDERR_FILENO < fd); ASSERT (is_open (fd)); + /* Ignore any other fd's leaked into this process. */ + close (fd + 1); + close (fd + 2); ASSERT (!is_open (fd + 1)); ASSERT (!is_open (fd + 2)); -- 1.6.3.2 -- View this message in context: http://www.nabble.com/Re%3A-findutils-git%3A-1-test-may-fail-tp24797929p24956214.html Sent from the Gnulib mailing list archive at Nabble.com.