X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-dup2.c;h=e2ad88bccaf217d880e61548211530d2176f9368;hb=b5aab1e9a03e2abc2c518ccafb5313a9697614ea;hp=cef9a304d60ac21e9c45a4ac9dcfffa17bb79346;hpb=e016983c7406fb8aa0c750053425ffb3cbaeec4a;p=pspp diff --git a/tests/test-dup2.c b/tests/test-dup2.c index cef9a304d6..e2ad88bcca 100644 --- a/tests/test-dup2.c +++ b/tests/test-dup2.c @@ -1,5 +1,5 @@ /* Test duplicating file descriptors. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2011 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 @@ -169,7 +169,12 @@ main (void) ASSERT (dup2 (fd + 1, fd + 1) == fd + 1); ASSERT (!is_inheritable (fd + 1)); ASSERT (dup2 (fd + 1, fd + 2) == fd + 2); + ASSERT (!is_inheritable (fd + 1)); ASSERT (is_inheritable (fd + 2)); + errno = 0; + ASSERT (dup2 (fd + 1, -1) == -1); + ASSERT (errno == EBADF); + ASSERT (!is_inheritable (fd + 1)); #endif /* On systems that distinguish between text and binary mode, dup2