Cygwin InstallXLogFileSegment() rename() patch
- From: Jason Tishler <jason@tishler.net>
- To: Pgsql-Patches <pgsql-patches@postgresql.org>
- Cc: Pgsql-Cygwin <pgsql-cygwin@postgresql.org>, "David P. Caldwell" <inonit@inonit.com>, Barry Pederson <bp@barryp.org>
- Subject: Cygwin InstallXLogFileSegment() rename() patch
- Date: Mon, 13 May 2002 14:03:06 -0400
- Message-id: <20020513180306.GD1408@tishler.net>
The attached patch fixes a problem with InstallXLogFileSegment()'s use
of link() under Cygwin:
http://archives.postgresql.org/pgsql-cygwin/2002-04/msg00072.php
Note that it appears that BeOS and Netware also have the above or
similar problem.
I have only verified that PostgreSQL builds under Cygwin with this patch.
Since I cannot reproduce the problem, I cannot verify that the proposed
patch solves it. Nevertheless, both Barry Pederson and David P. Caldwell
attest that this patch solves the problem. See the following for details:
http://archives.postgresql.org/pgsql-cygwin/2002-05/msg00043.php
http://archives.postgresql.org/pgsql-cygwin/2002-05/msg00040.php
Thanks,
Jason
Index: xlog.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.94
diff -u -p -r1.94 xlog.c
--- xlog.c 2002/05/09 13:30:24 1.94
+++ xlog.c 2002/05/13 15:41:16
@@ -1503,7 +1503,7 @@ InstallXLogFileSegment(uint32 log, uint3
* overwrite an existing logfile. However, there shouldn't be one, so
* rename() is an acceptable substitute except for the truly paranoid.
*/
-#if !defined(__BEOS__) && !defined(N_PLAT_NLM)
+#if !defined(__BEOS__) && !defined(N_PLAT_NLM) && !defined(__CYGWIN__)
if (link(tmppath, path) < 0)
elog(PANIC, "link from %s to %s (initialization of log file %u, segment %u) failed: %m",
tmppath, path, log, seg);
Home |
Main Index |
Thread Index