diff src/nt.c @ 211:78478c60bfcd r20-4b4

Import from CVS: tag r20-4b4
author cvs
date Mon, 13 Aug 2007 10:05:51 +0200
parents 41ff10fd062f
children 78f53ef88e17
line wrap: on
line diff
--- a/src/nt.c	Mon Aug 13 10:05:01 2007 +0200
+++ b/src/nt.c	Mon Aug 13 10:05:51 2007 +0200
@@ -1461,8 +1461,15 @@
 int
 sys_open (const char * path, int oflag, int mode)
 {
+  int		fd;
+
   /* Force all file handles to be non-inheritable. */
-  return _open (map_win32_filename (path, NULL), oflag | _O_NOINHERIT, mode);
+  fd = _open (map_win32_filename (path, NULL), oflag | _O_NOINHERIT, mode);
+  if (fd >= 0)
+    {
+      fd_info[fd].cp = 0;
+    }
+  return (fd);
 }
 
 int
@@ -1740,7 +1747,8 @@
       BY_HANDLE_FILE_INFORMATION info;
 
       /* No access rights required to get info.  */
-      fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+      fh = CreateFile (name, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
+		       OPEN_EXISTING, 0, NULL);
 
       if (GetFileInformationByHandle (fh, &info))
 	{