Explicitly close file descriptors where needed.
authorBruno Haible <bruno@clisp.org>
Thu, 31 May 2007 01:09:03 +0000 (01:09 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 31 May 2007 01:09:03 +0000 (01:09 +0000)
ChangeLog
tests/test-lseek.c

index e9eb64d..4218544 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-30  Bruno Haible  <bruno@clisp.org>
+
+       * tests/test-lseek.c: Explicitly close file descriptors 0 and 1 before
+       assuming that they are closed. Needed on HP-UX 11.
+
 2007-05-29  Bruno Haible  <bruno@clisp.org>
 
        Fix a problem with #include_next.
index d70629e..f8fcfec 100644 (file)
@@ -72,6 +72,10 @@ main (int argc, char **argv)
       break;
 
     case '2': /* closed */
+      /* Explicitly close file descriptors 0 and 1.  The <&- and >&- in the
+         invoking shell are not enough on HP-UX.  */
+      close (0);
+      close (1);
       errno = 0;
       ASSERT (lseek (0, (off_t)0, SEEK_CUR) == -1);
       ASSERT (errno == EBADF);