Explicitly close file descriptors where needed.
[gnulib.git] / tests / test-lseek.c
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);