Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Cygwin InstallXLogFileSegment() rename() patch



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

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group