1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Apply Win32 patch from Horak Daniel.

This commit is contained in:
Bruce Momjian
1999-01-17 06:20:06 +00:00
parent 298682d9e0
commit 7a6b562fdf
58 changed files with 484 additions and 86 deletions

View File

@@ -6,7 +6,7 @@
# Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.41 1998/11/12 05:27:01 tgl Exp $
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.42 1999/01/17 06:19:34 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -36,7 +36,11 @@ endif
# If crypt is a separate library, rather than part of libc,
# make sure it gets included in shared libpq.
ifeq ($(PORTNAME), win)
SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
else
SHLIB_LINK= $(findstring -lcrypt,$(LIBS))
endif
# Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib
@@ -139,6 +143,9 @@ beforeinstall-headers:
clean:
rm -f libpq.a $(shlib) $(OBJS)
rm -f dllist.c common.c wchar.c conv.c
ifeq ($(PORTNAME), win)
rm -f pq.def
endif
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.87 1999/01/17 03:37:19 tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.88 1999/01/17 06:19:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -567,7 +567,7 @@ connectDB(PGconn *conn)
conn->raddr.in.sin_port = htons((unsigned short) (portno));
conn->raddr_len = sizeof(struct sockaddr_in);
}
#ifndef WIN32
#if !defined(WIN32) && !defined(__CYGWIN32__)
else
conn->raddr_len = UNIXSOCK_PATH(conn->raddr.un, portno);
#endif

View File

@@ -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,