mirror of
https://github.com/postgres/postgres.git
synced 2025-08-06 18:42:54 +03:00
pg_upgrade: fix CopyFile() on Windows to fail on file existence
Also fix getErrorText() to return the right error string on failure. This behavior now matches that of other operating systems. Report by Noah Misch Backpatch through 9.1
This commit is contained in:
@@ -234,18 +234,15 @@ get_user_info(char **user_name_p)
|
||||
/*
|
||||
* getErrorText()
|
||||
*
|
||||
* Returns the text of the error message for the given error number
|
||||
*
|
||||
* This feature is factored into a separate function because it is
|
||||
* system-dependent.
|
||||
* Returns the text of the most recent error
|
||||
*/
|
||||
const char *
|
||||
getErrorText(int errNum)
|
||||
getErrorText(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
_dosmaperr(GetLastError());
|
||||
#endif
|
||||
return pg_strdup(strerror(errNum));
|
||||
return pg_strdup(strerror(errno));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user