diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-10-17 23:53:30 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-10-17 23:53:30 +0000 |
commit | edb1ba113d767dede2a413ed46fe801a99706611 (patch) | |
tree | 36fc63468ad033394e32179cdce22308dced0076 /src/port | |
parent | 1311667b5c2b9d75af1eb9b60f247268f7db70f8 (diff) | |
download | postgresql-edb1ba113d767dede2a413ed46fe801a99706611.tar.gz |
Better document win32_open and its ability to allow concurrent
unlink/rename().
Diffstat (limited to 'src/port')
-rw-r--r-- | src/port/dirmod.c | 6 | ||||
-rw-r--r-- | src/port/open.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/port/dirmod.c b/src/port/dirmod.c index 5bb53f08c8..6035b81bc5 100644 --- a/src/port/dirmod.c +++ b/src/port/dirmod.c @@ -10,7 +10,7 @@ * Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.29 2004/10/17 23:39:22 momjian Exp $ + * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.30 2004/10/17 23:53:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -68,7 +68,7 @@ pgrename(const char *from, const char *to) { int loops = 0; - /* Is this loop even necessary? */ + /* Is this loop even necessary now that we have win32_open()? */ #if defined(WIN32) && !defined(__CYGWIN__) while (!MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING)) #endif @@ -114,7 +114,7 @@ pgunlink(const char *path) { int loops = 0; - /* Is this loop even necessary? */ + /* Is this loop even necessary now that we have win32_open()? */ while (unlink(path)) { if (errno != EACCES) diff --git a/src/port/open.c b/src/port/open.c index 3304d443c6..34fd95e670 100644 --- a/src/port/open.c +++ b/src/port/open.c @@ -6,7 +6,7 @@ * * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/port/open.c,v 1.4 2004/08/29 05:07:02 momjian Exp $ + * $PostgreSQL: pgsql/src/port/open.c,v 1.5 2004/10/17 23:53:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -71,6 +71,7 @@ win32_open(const char *fileName, int fileFlags,...) /* cannot use O_RDONLY, as it == 0 */ (fileFlags & O_RDWR) ? (GENERIC_WRITE | GENERIC_READ) : ((fileFlags & O_WRONLY) ? GENERIC_WRITE : GENERIC_READ), + /* These flags allow concurrent rename/unlink */ (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), &sa, openFlagsToCreateFileFlags(fileFlags), |