* Christian Ullrich wrote:

* Tom Lane wrote:

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

zic aborts somewhere between writing Etc/UTC and UTC.

Huh ... I would not have guessed that.  Can you track down exactly
where it's failing?

I'd love to, but with 656ee84 I cannot reproduce on my Windows 10
system. I can try on the animals where it actually failed, but now that
there's a fix, that won't be necessary, right?

Weird. vcregress check works, install fails. Perhaps the directories are precreated for check?

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.

The additional mkdirs() call just papers over the actual bug; the existing one in line 802 will do nicely once it actually runs.

Patch attached.

--
Christian

diff --git a/src/timezone/zic.c b/src/timezone/zic.c
new file mode 100644
index 8d4347a..ce30740
*** a/src/timezone/zic.c
--- b/src/timezone/zic.c
*************** int
*** 3485,3491 ****
--- 3485,3496 ----
  link(const char *oldpath, const char *newpath)
  {
        if (!CopyFile(oldpath, newpath, false))
+       {
+               DWORD err = GetLastError();
+               if (err == ERROR_PATH_NOT_FOUND || err == ERROR_FILE_NOT_FOUND)
+                       errno = ENOENT;
                return -1;
+       }
        return 0;
  }
  #endif
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to