X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-dup3.c;h=eb26c8f111bec1265cebdbd0511465c5319b0e39;hb=69770559f5bf198928150ac8162734d7f6b99c82;hp=4392f9e3c260aa19938c74953c1563840214da45;hpb=f0b08ae92b4d606bd95773c2b3c263d0b83e1172;p=gnulib.git diff --git a/tests/test-dup3.c b/tests/test-dup3.c index 4392f9e3c..eb26c8f11 100644 --- a/tests/test-dup3.c +++ b/tests/test-dup3.c @@ -1,5 +1,5 @@ /* Test duplicating file descriptors. - Copyright (C) 2009-2012 Free Software Foundation, Inc. + Copyright (C) 2009-2013 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 @@ -76,6 +76,7 @@ int main () { int use_cloexec; + int bad_fd = getdtablesize (); #if O_CLOEXEC for (use_cloexec = 0; use_cloexec <= 1; use_cloexec++) @@ -124,7 +125,7 @@ main () ASSERT (dup3 (fd, -2, o_flags) == -1); ASSERT (errno == EBADF); errno = 0; - ASSERT (dup3 (fd, 10000000, o_flags) == -1); + ASSERT (dup3 (fd, bad_fd, o_flags) == -1); ASSERT (errno == EBADF); /* Using dup3 can skip fds. */