diff options
Diffstat (limited to 'src/backend/libpq/be-fsstubs.c')
-rw-r--r-- | src/backend/libpq/be-fsstubs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c index b35eba81ca0..0e6bd7f5228 100644 --- a/src/backend/libpq/be-fsstubs.c +++ b/src/backend/libpq/be-fsstubs.c @@ -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 */ |