Fix zic for Windows.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Mar 2016 14:40:08 +0000 (10:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Mar 2016 14:40:08 +0000 (10:40 -0400)
The new coding of dolink() is dependent on link() returning an on-point
errno when it fails; but the quick-hack implementation of link() that
we'd put in for Windows didn't bother with setting errno.  Fix that.

Analysis and patch by Christian Ullrich.

src/timezone/zic.c

index 8d4347a47a31fbd27452b76bae74b6fd3acd12dc..f9cbac9f0068698775a51c3d9114cf1824317870 100644 (file)
@@ -3485,7 +3485,10 @@ int
 link(const char *oldpath, const char *newpath)
 {
        if (!CopyFile(oldpath, newpath, false))
+       {
+               _dosmaperr(GetLastError());
                return -1;
+       }
        return 0;
 }
 #endif