mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Apply Win32 patch from Horak Daniel.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.26 1998/09/01 04:28:46 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.27 1999/01/17 06:18:24 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This should be moved to a more appropriate place. It is here
|
||||
@@ -267,7 +267,11 @@ lo_import(text *filename)
|
||||
* open the file to be read in
|
||||
*/
|
||||
StrNCpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ + 1);
|
||||
#ifndef __CYGWIN32__
|
||||
fd = open(fnamebuf, O_RDONLY, 0666);
|
||||
#else
|
||||
fd = open(fnamebuf, O_RDONLY | O_BINARY, 0666);
|
||||
#endif
|
||||
if (fd < 0)
|
||||
{ /* error */
|
||||
elog(ERROR, "be_lo_import: can't open unix file\"%s\"\n",
|
||||
@@ -341,7 +345,11 @@ lo_export(Oid lobjId, text *filename)
|
||||
*/
|
||||
oumask = umask((mode_t) 0);
|
||||
StrNCpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ + 1);
|
||||
#ifndef __CYGWIN32__
|
||||
fd = open(fnamebuf, O_CREAT | O_WRONLY | O_TRUNC, 0666);
|
||||
#else
|
||||
fd = open(fnamebuf, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666);
|
||||
#endif
|
||||
umask(oumask);
|
||||
if (fd < 0)
|
||||
{ /* error */
|
||||
|
||||
Reference in New Issue
Block a user