From c18578632fd3c9e513e613a86ba2b7c4ebee6c45 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 30 Sep 2014 18:22:48 +0400 Subject: Imported Upstream version 8.23 --- gnulib-tests/test-dup-safer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gnulib-tests/test-dup-safer.c') diff --git a/gnulib-tests/test-dup-safer.c b/gnulib-tests/test-dup-safer.c index d7567e01..d11891e7 100644 --- a/gnulib-tests/test-dup-safer.c +++ b/gnulib-tests/test-dup-safer.c @@ -1,5 +1,5 @@ /* Test that dup_safer leaves standard fds alone. - Copyright (C) 2009-2013 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #include #include #include +#include #include "binary-io.h" #include "cloexec.h" @@ -107,6 +108,7 @@ main (void) { int i; int fd; + int bad_fd = getdtablesize (); /* We close fd 2 later, so save it in fd 10. */ if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO @@ -129,7 +131,7 @@ main (void) ASSERT (dup (-1) == -1); ASSERT (errno == EBADF); errno = 0; - ASSERT (dup (10000000) == -1); + ASSERT (dup (bad_fd) == -1); ASSERT (errno == EBADF); close (fd + 1); errno = 0; -- cgit v1.2.3