From 7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 17 Jan 1999 06:20:06 +0000 Subject: Apply Win32 patch from Horak Daniel. --- src/backend/libpq/be-fsstubs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/backend/libpq/be-fsstubs.c') diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c index b35eba81ca..0e6bd7f522 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 */ -- cgit v1.2.1