From 6cb0b1b13da2ad2bfd1531cf9add91618034b18b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 10 Feb 2001 05:50:29 +0000 Subject: [PATCH] Properly exit ODBC with 'X', allow linking on BSD/OS. --- GNUmakefile | 9 +++++++-- bind.c | 1 - columninfo.c | 1 - connection.c | 1 - convert.c | 1 - dlg_specific.c | 1 - drvconn.c | 1 - environ.c | 1 - execute.c | 1 - info.c | 1 - lobj.c | 1 - misc.c | 1 - options.c | 1 - parse.c | 1 - pgtypes.c | 1 - psqlodbc.c | 1 - qresult.c | 1 - results.c | 1 - setup.c | 1 - socket.c | 5 ++++- statement.c | 1 - tuple.c | 1 - tuplelist.c | 1 - 23 files changed, 11 insertions(+), 24 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index a4874bc..50b6d23 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -2,7 +2,7 @@ # # GNUMakefile for psqlodbc (Postgres ODBC driver) # -# $Header: /home/heikki/psqlodbc-cvs-copy/psqlodbc/Attic/GNUmakefile,v 1.8 2000/12/16 18:14:25 petere Exp $ +# $Header: /home/heikki/psqlodbc-cvs-copy/psqlodbc/Attic/GNUmakefile,v 1.9 2001/02/10 05:50:27 momjian Exp $ # #------------------------------------------------------------------------- @@ -24,7 +24,6 @@ OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \ gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX) SHLIB_LINK = $(filter -lm, $(LIBS)) - all: all-lib # Shared library stuff @@ -33,7 +32,13 @@ include $(top_srcdir)/src/Makefile.shlib # Symbols must be resolved to the version in the shared library because # the driver manager (e.g., iodbc) provides some symbols with the same # names and we don't want those. (This issue is probably ELF specific.) +# +# BSD/OS fails with libc and crt1.o undefined symbols without this. +# bjm 2001-02-09 +# +ifneq ($(PORTNAME), bsdi) LINK.shared += $(shlib_symbolic) +endif odbc_headers = isql.h isqlext.h iodbc.h odbc_includedir = $(includedir)/iodbc diff --git a/bind.c b/bind.c index 6ec25f8..ce25c4a 100644 --- a/bind.c +++ b/bind.c @@ -1,4 +1,3 @@ - /* Module: bind.c * * Description: This module contains routines related to binding diff --git a/columninfo.c b/columninfo.c index 9e5223b..75fdd9f 100644 --- a/columninfo.c +++ b/columninfo.c @@ -1,4 +1,3 @@ - /* Module: columninfo.c * * Description: This module contains routines related to diff --git a/connection.c b/connection.c index b528a69..7d20e4c 100644 --- a/connection.c +++ b/connection.c @@ -1,4 +1,3 @@ - /* Module: connection.c * * Description: This module contains routines related to diff --git a/convert.c b/convert.c index 95ac701..f033ce4 100644 --- a/convert.c +++ b/convert.c @@ -1,4 +1,3 @@ - /* Module: convert.c * * Description: This module contains routines related to diff --git a/dlg_specific.c b/dlg_specific.c index 13e8b44..9be8b3c 100644 --- a/dlg_specific.c +++ b/dlg_specific.c @@ -1,4 +1,3 @@ - /* Module: dlg_specific.c * * Description: This module contains any specific code for handling diff --git a/drvconn.c b/drvconn.c index 2cbe6e6..cbc2546 100644 --- a/drvconn.c +++ b/drvconn.c @@ -1,4 +1,3 @@ - /* Module: drvconn.c * * Description: This module contains only routines related to diff --git a/environ.c b/environ.c index 080a802..637b5fc 100644 --- a/environ.c +++ b/environ.c @@ -1,4 +1,3 @@ - /* Module: environ.c * * Description: This module contains routines related to diff --git a/execute.c b/execute.c index ac5d0b1..57199f7 100644 --- a/execute.c +++ b/execute.c @@ -1,4 +1,3 @@ - /* Module: execute.c * * Description: This module contains routines related to diff --git a/info.c b/info.c index bf43d65..9ee92c0 100644 --- a/info.c +++ b/info.c @@ -1,4 +1,3 @@ - /* Module: info.c * * Description: This module contains routines related to diff --git a/lobj.c b/lobj.c index 8d98ee3..c31591a 100644 --- a/lobj.c +++ b/lobj.c @@ -1,4 +1,3 @@ - /* Module: lobj.c * * Description: This module contains routines related to manipulating diff --git a/misc.c b/misc.c index 5d0a19c..b35c5c3 100644 --- a/misc.c +++ b/misc.c @@ -1,4 +1,3 @@ - /* Module: misc.c * * Description: This module contains miscellaneous routines diff --git a/options.c b/options.c index ccc4192..67c973e 100644 --- a/options.c +++ b/options.c @@ -1,4 +1,3 @@ - /* Module: options.c * * Description: This module contains routines for getting/setting diff --git a/parse.c b/parse.c index 690a902..dd85e66 100644 --- a/parse.c +++ b/parse.c @@ -1,4 +1,3 @@ - /* Module: parse.c * * Description: This module contains routines related to parsing SQL statements. diff --git a/pgtypes.c b/pgtypes.c index ebee8ab..91a1b3d 100644 --- a/pgtypes.c +++ b/pgtypes.c @@ -1,4 +1,3 @@ - /* Module: pgtypes.c * * Description: This module contains routines for getting information diff --git a/psqlodbc.c b/psqlodbc.c index dbf4029..c5770f9 100644 --- a/psqlodbc.c +++ b/psqlodbc.c @@ -1,4 +1,3 @@ - /* Module: psqlodbc.c * * Description: This module contains the main entry point (DllMain) for the library. diff --git a/qresult.c b/qresult.c index de52884..eaffef5 100644 --- a/qresult.c +++ b/qresult.c @@ -1,4 +1,3 @@ - /* Module: qresult.c * * Description: This module contains functions related to diff --git a/results.c b/results.c index 8ef3936..3ef098a 100644 --- a/results.c +++ b/results.c @@ -1,4 +1,3 @@ - /* Module: results.c * * Description: This module contains functions related to diff --git a/setup.c b/setup.c index 8c3ba4d..4c31afe 100644 --- a/setup.c +++ b/setup.c @@ -1,4 +1,3 @@ - /* Module: setup.c * * Description: This module contains the setup functions for diff --git a/socket.c b/socket.c index 30fb56f..917951f 100644 --- a/socket.c +++ b/socket.c @@ -1,4 +1,3 @@ - /* Module: socket.c * * Description: This module contains functions for low level socket @@ -78,7 +77,11 @@ SOCK_Destructor(SocketClass *self) { if (self->socket != -1) { if ( ! shutdown(self->socket, 2)) /* no sends or receives */ + { + SOCK_put_char(self, 'X'); + SOCK_flush_output(self); closesocket(self->socket); + } } if (self->buffer_in) diff --git a/statement.c b/statement.c index 06d97f7..b0ea3a9 100644 --- a/statement.c +++ b/statement.c @@ -1,4 +1,3 @@ - /* Module: statement.c * * Description: This module contains functions related to creating diff --git a/tuple.c b/tuple.c index 303476f..968f098 100644 --- a/tuple.c +++ b/tuple.c @@ -1,4 +1,3 @@ - /* Module: tuple.c * * Description: This module contains functions for setting the data for individual diff --git a/tuplelist.c b/tuplelist.c index 31acb9c..7511089 100644 --- a/tuplelist.c +++ b/tuplelist.c @@ -1,4 +1,3 @@ - /* Module: tuplelist.c * * Description: This module contains functions for creating a manual result set -- 2.39.5