pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Ullrich <chris@chrullrich.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: michael.paquier@gmail.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Sync tzload() and tzparse() APIs with IANA release tzcode2016c.
Date: Tue, 29 Mar 2016 16:11:42 +0200
Message-ID: <56FA8D1E.1090709@chrullrich.net> (raw)
In-Reply-To: <31133.1459259312@sss.pgh.pa.us>
References: <E1akeZU-0003B5-HB@gemulon.postgresql.org>
	<CAB7nPqQHd1manQ2Yn3P6L82KNMR_iGC2v5AhVgygiCOc2XpbKQ@mail.gmail.com>
	<32628.1459221714@sss.pgh.pa.us>
	<56FA0634.9020007@chrullrich.net>
	<14980.1459228179@sss.pgh.pa.us>
	<56FA28AD.3080604@chrullrich.net>
	<56FA4AA5.4030205@chrullrich.net>
	<31133.1459259312@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

* Tom Lane wrote:

> Christian Ullrich <chris@chrullrich.net> writes:

>> Anyway, I think Michael's fix is wrong. The bug is that the Win32
>> version of link() (at the bottom of zic.c) does not set errno if its
>> attempt to copy the file fails, so what dolink() puts into link_errno is
>> bogus.
>
> Ah-hah, that explains things nicely.  The previous coding in dolink()
> wasn't so dependent on link() returning a valid errno on failure.
>
>> Patch attached.
>
> But then, should not this code make sure that errno *always* gets set?

A library function that does not fail does not touch errno. This link() 
replacement is an honorary library function, so neither should it.

> I'd be inclined to think we should use _dosmaperr(), too, rather than
> hand-coding it.

Yes, of course. If only I had known about it ...

New patch attached.

-- 
Christian

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

zic-link.patch (text/plain, 383B) download diff --git a/src/timezone/zic.c b/src/timezone/zic.c new file mode 100644 index 8d4347a..f9cbac9 *** a/src/timezone/zic.c --- b/src/timezone/zic.c *************** int *** 3485,3491 **** --- 3485,3494 ---- link(const char *oldpath, const char *newpath) { if (!CopyFile(oldpath, newpath, false)) + { + _dosmaperr(GetLastError()); return -1; + } return 0; } #endif

view thread (13+ messages)  latest in thread

Message-ID: <56FA8D1E.1090709@chrullrich.net>
Permalink:  ../56FA8D1E.1090709@chrullrich.net/
Also on:    postgresql.org/message-id/56FA8D1E.1090709@chrullrich.net

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: chris@chrullrich.net, tgl@sss.pgh.pa.us, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Sync tzload() and tzparse() APIs with IANA release tzcode2016c.
  In-Reply-To: <56FA8D1E.1090709@chrullrich.net>
  References: <E1akeZU-0003B5-HB@gemulon.postgresql.org> <CAB7nPqQHd1manQ2Yn3P6L82KNMR_iGC2v5AhVgygiCOc2XpbKQ@mail.gmail.com> <32628.1459221714@sss.pgh.pa.us> <56FA0634.9020007@chrullrich.net> <14980.1459228179@sss.pgh.pa.us> <56FA28AD.3080604@chrullrich.net> <56FA4AA5.4030205@chrullrich.net> <31133.1459259312@sss.pgh.pa.us> <56FA8D1E.1090709@chrullrich.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox