From: Magnus Hagander Date: Fri, 30 Nov 2007 11:16:46 +0000 (+0000) Subject: Use _dosmaperr() to deal with errors opening files in pgwin32_open(). X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=f50bd513c58947d3d27cb43473cf17a878bc4721;p=users%2Fbernd%2Fpostgres.git Use _dosmaperr() to deal with errors opening files in pgwin32_open(). Per complaint from Alvaro and subsequent discussion. --- diff --git a/src/port/open.c b/src/port/open.c index 73daa7c34b..9e19223737 100644 --- a/src/port/open.c +++ b/src/port/open.c @@ -85,22 +85,7 @@ pgwin32_open(const char *fileName, int fileFlags,...) ((fileFlags & O_DSYNC) ? FILE_FLAG_WRITE_THROUGH : 0), NULL)) == INVALID_HANDLE_VALUE) { - switch (GetLastError()) - { - /* EMFILE, ENFILE should not occur from CreateFile. */ - case ERROR_PATH_NOT_FOUND: - case ERROR_FILE_NOT_FOUND: - errno = ENOENT; - break; - case ERROR_FILE_EXISTS: - errno = EEXIST; - break; - case ERROR_ACCESS_DENIED: - errno = EACCES; - break; - default: - errno = EINVAL; - } + _dosmaperr(GetLastError()); return -1; }