aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-lobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/libpq/fe-lobj.c')
-rw-r--r--src/interfaces/libpq/fe-lobj.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 19c7770f3f1..7fd52737bf0 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.17 1998/10/01 01:40:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.18 1999/01/17 06:19:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -392,7 +392,11 @@ lo_import(PGconn *conn, char *filename)
/*
* open the file to be read in
*/
+#ifndef __CYGWIN32__
fd = open(filename, O_RDONLY, 0666);
+#else
+ fd = open(filename, O_RDONLY | O_BINARY, 0666);
+#endif
if (fd < 0)
{ /* error */
sprintf(conn->errorMessage,
@@ -467,7 +471,11 @@ lo_export(PGconn *conn, Oid lobjId, char *filename)
/*
* open the file to be written to
*/
+#ifndef __CYGWIN32__
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0666);
+#else
+ fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666);
+#endif
if (fd < 0)
{ /* error */
sprintf(conn->errorMessage,