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.
link(const char *oldpath, const char *newpath)
{
if (!CopyFile(oldpath, newpath, false))
+ {
+ _dosmaperr(GetLastError());
return -1;
+ }
return 0;
}
#endif