Slight improvement to :win32 layer
Nick Ing-Simmons [Tue, 18 Jun 2002 07:03:08 +0000 (07:03 +0000)]
p4raw-id: //depot/perlio@17280

win32/win32io.c

index 4e61aaa..3cf31c5 100644 (file)
@@ -288,13 +288,19 @@ PerlIOWin32_close(pTHX_ PerlIO *f)
  PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32);
  if (s->refcnt == 1)
   {
-   if (CloseHandle(s->h))
+   IV code = 0;          
+#if 0
+   /* This does not do pipes etc. correctly */   
+   if (!CloseHandle(s->h))
     {
      s->h = INVALID_HANDLE_VALUE;
      return -1;
     }
+#else
+    PerlIOBase(f)->flags &= ~PERLIO_F_OPEN;
+    return win32_close(s->fd);
+#endif
   }
- PerlIOBase(f)->flags &= ~PERLIO_F_OPEN;
  return 0;
 }