]> granicus.if.org Git - postgresql/commitdiff
The attached patch fixes a problem with InstallXLogFileSegment()'s use
authorBruce Momjian <bruce@momjian.us>
Fri, 7 Jun 2002 21:47:45 +0000 (21:47 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 7 Jun 2002 21:47:45 +0000 (21:47 +0000)
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

Jason Tishler

src/backend/access/transam/xlog.c

index 77ad566ba89c1fc5b80676b02be07ff8d543e720..c80c73f9e3626b7e67632d6a03e372aee60b3718 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.95 2002/05/17 01:19:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.96 2002/06/07 21:47:45 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1503,7 +1503,7 @@ InstallXLogFileSegment(uint32 log, uint32 seg, char *tmppath,
         * 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);