Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Asif Naeem <anaeem(dot)it(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation
Date: 2014-04-04 19:04:03
Message-ID: 20140404190403.GA27702@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-03-25 21:09:13 +0900, MauMau wrote:
> ! /*
> ! * Remove old symlink in recovery, in case it points to the wrong place.
> ! * On Windows, lstat() reports junction points as directories.
> ! */
> if (InRecovery)
> {
> ! if (lstat(linkloc, &st) == 0 && S_ISDIR(st.st_mode))
> ! {
> ! if (rmdir(linkloc) < 0)
> ! ereport(ERROR,
> ! (errcode_for_file_access(),
> ! errmsg("could not remove directory \"%s\": %m",
> ! linkloc)));
> ! }
> ! else
> ! {
> ! if (unlink(linkloc) < 0 && errno != ENOENT)
> ! ereport(ERROR,
> ! (errcode_for_file_access(),
> ! errmsg("could not remove symbolic link \"%s\": %m",
> ! linkloc)));
> ! }
> }

if (..)
...
else
{
if (...)
...
}

is pretty odd code layout.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-04-04 19:36:27 Re: Using indices for UNION.
Previous Message Tom Lane 2014-04-04 18:56:54 Re: Another thought about search_path semantics