comparison 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
comparison
equal deleted inserted replaced
210:49f55ca3ba57 211:78478c60bfcd
1459 } 1459 }
1460 1460
1461 int 1461 int
1462 sys_open (const char * path, int oflag, int mode) 1462 sys_open (const char * path, int oflag, int mode)
1463 { 1463 {
1464 int fd;
1465
1464 /* Force all file handles to be non-inheritable. */ 1466 /* Force all file handles to be non-inheritable. */
1465 return _open (map_win32_filename (path, NULL), oflag | _O_NOINHERIT, mode); 1467 fd = _open (map_win32_filename (path, NULL), oflag | _O_NOINHERIT, mode);
1468 if (fd >= 0)
1469 {
1470 fd_info[fd].cp = 0;
1471 }
1472 return (fd);
1466 } 1473 }
1467 1474
1468 int 1475 int
1469 sys_rename (const char * oldname, const char * newname) 1476 sys_rename (const char * oldname, const char * newname)
1470 { 1477 {
1738 of links, but is quite slow (it is noticable when Emacs is 1745 of links, but is quite slow (it is noticable when Emacs is
1739 making a list of file name completions). */ 1746 making a list of file name completions). */
1740 BY_HANDLE_FILE_INFORMATION info; 1747 BY_HANDLE_FILE_INFORMATION info;
1741 1748
1742 /* No access rights required to get info. */ 1749 /* No access rights required to get info. */
1743 fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, 0, NULL); 1750 fh = CreateFile (name, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
1751 OPEN_EXISTING, 0, NULL);
1744 1752
1745 if (GetFileInformationByHandle (fh, &info)) 1753 if (GetFileInformationByHandle (fh, &info))
1746 { 1754 {
1747 switch (GetFileType (fh)) 1755 switch (GetFileType (fh))
1748 { 1756 {