Commit f509944e authored by Magnus Hagander's avatar Magnus Hagander

Fix cast for _open_osfhandle().

Tsutomu Yamada
parent 7839d359
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * 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,...) ...@@ -124,7 +124,7 @@ pgwin32_open(const char *fileName, int fileFlags,...)
} }
/* _open_osfhandle will, on error, set errno accordingly */ /* _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 */ CloseHandle(h); /* will not affect errno */
else if (fileFlags & (O_TEXT | O_BINARY) && else if (fileFlags & (O_TEXT | O_BINARY) &&
_setmode(fd, fileFlags & (O_TEXT | O_BINARY)) < 0) _setmode(fd, fileFlags & (O_TEXT | O_BINARY)) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment