mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Fix cast for _open_osfhandle().
Tsutomu Yamada
This commit is contained in:
parent
7839d35991
commit
f509944e6e
@ -6,7 +6,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/port/open.c,v 1.28 2009/06/11 14:49:15 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/port/open.c,v 1.29 2010/01/02 12:00:08 mha Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -124,7 +124,7 @@ pgwin32_open(const char *fileName, int fileFlags,...)
|
||||
}
|
||||
|
||||
/* _open_osfhandle will, on error, set errno accordingly */
|
||||
if ((fd = _open_osfhandle((long) h, fileFlags & O_APPEND)) < 0)
|
||||
if ((fd = _open_osfhandle((intptr_t) h, fileFlags & O_APPEND)) < 0)
|
||||
CloseHandle(h); /* will not affect errno */
|
||||
else if (fileFlags & (O_TEXT | O_BINARY) &&
|
||||
_setmode(fd, fileFlags & (O_TEXT | O_BINARY)) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user