From fd40942fd8f99dd46da1dcb49fae58f607aea179 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. --- src/interfaces/odbc/GNUmakefile | 9 +++++++-- src/interfaces/odbc/bind.c | 1 - src/interfaces/odbc/columninfo.c | 1 - src/interfaces/odbc/connection.c | 1 - src/interfaces/odbc/convert.c | 1 - src/interfaces/odbc/dlg_specific.c | 1 - src/interfaces/odbc/drvconn.c | 1 - src/interfaces/odbc/environ.c | 1 - src/interfaces/odbc/execute.c | 1 - src/interfaces/odbc/info.c | 1 - src/interfaces/odbc/lobj.c | 1 - src/interfaces/odbc/misc.c | 1 - src/interfaces/odbc/options.c | 1 - src/interfaces/odbc/parse.c | 1 - src/interfaces/odbc/pgtypes.c | 1 - src/interfaces/odbc/psqlodbc.c | 1 - src/interfaces/odbc/qresult.c | 1 - src/interfaces/odbc/results.c | 1 - src/interfaces/odbc/setup.c | 1 - src/interfaces/odbc/socket.c | 5 ++++- src/interfaces/odbc/statement.c | 1 - src/interfaces/odbc/tuple.c | 1 - src/interfaces/odbc/tuplelist.c | 1 - 23 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/interfaces/odbc/GNUmakefile b/src/interfaces/odbc/GNUmakefile index 7a1542f3d4..7265512a9f 100644 --- a/src/interfaces/odbc/GNUmakefile +++ b/src/interfaces/odbc/GNUmakefile @@ -2,7 +2,7 @@ # # GNUMakefile for psqlodbc (Postgres ODBC driver) # -# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.8 2000/12/16 18:14:25 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/odbc/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/src/interfaces/odbc/bind.c b/src/interfaces/odbc/bind.c index 6ec25f80d6..ce25c4a1c3 100644 --- a/src/interfaces/odbc/bind.c +++ b/src/interfaces/odbc/bind.c @@ -1,4 +1,3 @@ - /* Module: bind.c * * Description: This module contains routines related to binding diff --git a/src/interfaces/odbc/columninfo.c b/src/interfaces/odbc/columninfo.c index 9e5223b83b..75fdd9f4f6 100644 --- a/src/interfaces/odbc/columninfo.c +++ b/src/interfaces/odbc/columninfo.c @@ -1,4 +1,3 @@ - /* Module: columninfo.c * * Description: This module contains routines related to diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c index b528a69ea0..7d20e4cb4f 100644 --- a/src/interfaces/odbc/connection.c +++ b/src/interfaces/odbc/connection.c @@ -1,4 +1,3 @@ - /* Module: connection.c * * Description: This module contains routines related to diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c index 95ac701247..f033ce4b3f 100644 --- a/src/interfaces/odbc/convert.c +++ b/src/interfaces/odbc/convert.c @@ -1,4 +1,3 @@ - /* Module: convert.c * * Description: This module contains routines related to diff --git a/src/interfaces/odbc/dlg_specific.c b/src/interfaces/odbc/dlg_specific.c index 13e8b44e61..9be8b3cdd5 100644 --- a/src/interfaces/odbc/dlg_specific.c +++ b/src/interfaces/odbc/dlg_specific.c @@ -1,4 +1,3 @@ - /* Module: dlg_specific.c * * Description: This module contains any specific code for handling diff --git a/src/interfaces/odbc/drvconn.c b/src/interfaces/odbc/drvconn.c index 2cbe6e6a87..cbc2546726 100644 --- a/src/interfaces/odbc/drvconn.c +++ b/src/interfaces/odbc/drvconn.c @@ -1,4 +1,3 @@ - /* Module: drvconn.c * * Description: This module contains only routines related to diff --git a/src/interfaces/odbc/environ.c b/src/interfaces/odbc/environ.c index 080a8026d5..637b5fc160 100644 --- a/src/interfaces/odbc/environ.c +++ b/src/interfaces/odbc/environ.c @@ -1,4 +1,3 @@ - /* Module: environ.c * * Description: This module contains routines related to diff --git a/src/interfaces/odbc/execute.c b/src/interfaces/odbc/execute.c index ac5d0b19c3..57199f7396 100644 --- a/src/interfaces/odbc/execute.c +++ b/src/interfaces/odbc/execute.c @@ -1,4 +1,3 @@ - /* Module: execute.c * * Description: This module contains routines related to diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c index bf43d6522b..9ee92c0687 100644 --- a/src/interfaces/odbc/info.c +++ b/src/interfaces/odbc/info.c @@ -1,4 +1,3 @@ - /* Module: info.c * * Description: This module contains routines related to diff --git a/src/interfaces/odbc/lobj.c b/src/interfaces/odbc/lobj.c index 8d98ee33e4..c31591a65b 100644 --- a/src/interfaces/odbc/lobj.c +++ b/src/interfaces/odbc/lobj.c @@ -1,4 +1,3 @@ - /* Module: lobj.c * * Description: This module contains routines related to manipulating diff --git a/src/interfaces/odbc/misc.c b/src/interfaces/odbc/misc.c index 5d0a19c375..b35c5c3d5b 100644 --- a/src/interfaces/odbc/misc.c +++ b/src/interfaces/odbc/misc.c @@ -1,4 +1,3 @@ - /* Module: misc.c * * Description: This module contains miscellaneous routines diff --git a/src/interfaces/odbc/options.c b/src/interfaces/odbc/options.c index ccc419299d..67c973ec0a 100644 --- a/src/interfaces/odbc/options.c +++ b/src/interfaces/odbc/options.c @@ -1,4 +1,3 @@ - /* Module: options.c * * Description: This module contains routines for getting/setting diff --git a/src/interfaces/odbc/parse.c b/src/interfaces/odbc/parse.c index 690a902ec4..dd85e66dce 100644 --- a/src/interfaces/odbc/parse.c +++ b/src/interfaces/odbc/parse.c @@ -1,4 +1,3 @@ - /* Module: parse.c * * Description: This module contains routines related to parsing SQL statements. diff --git a/src/interfaces/odbc/pgtypes.c b/src/interfaces/odbc/pgtypes.c index ebee8ab262..91a1b3d37f 100644 --- a/src/interfaces/odbc/pgtypes.c +++ b/src/interfaces/odbc/pgtypes.c @@ -1,4 +1,3 @@ - /* Module: pgtypes.c * * Description: This module contains routines for getting information diff --git a/src/interfaces/odbc/psqlodbc.c b/src/interfaces/odbc/psqlodbc.c index dbf4029a4a..c5770f9d33 100644 --- a/src/interfaces/odbc/psqlodbc.c +++ b/src/interfaces/odbc/psqlodbc.c @@ -1,4 +1,3 @@ - /* Module: psqlodbc.c * * Description: This module contains the main entry point (DllMain) for the library. diff --git a/src/interfaces/odbc/qresult.c b/src/interfaces/odbc/qresult.c index de52884ff3..eaffef5b79 100644 --- a/src/interfaces/odbc/qresult.c +++ b/src/interfaces/odbc/qresult.c @@ -1,4 +1,3 @@ - /* Module: qresult.c * * Description: This module contains functions related to diff --git a/src/interfaces/odbc/results.c b/src/interfaces/odbc/results.c index 8ef3936a8a..3ef098a91b 100644 --- a/src/interfaces/odbc/results.c +++ b/src/interfaces/odbc/results.c @@ -1,4 +1,3 @@ - /* Module: results.c * * Description: This module contains functions related to diff --git a/src/interfaces/odbc/setup.c b/src/interfaces/odbc/setup.c index 8c3ba4d02a..4c31afed49 100644 --- a/src/interfaces/odbc/setup.c +++ b/src/interfaces/odbc/setup.c @@ -1,4 +1,3 @@ - /* Module: setup.c * * Description: This module contains the setup functions for diff --git a/src/interfaces/odbc/socket.c b/src/interfaces/odbc/socket.c index 30fb56f904..917951f49d 100644 --- a/src/interfaces/odbc/socket.c +++ b/src/interfaces/odbc/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/src/interfaces/odbc/statement.c b/src/interfaces/odbc/statement.c index 06d97f7457..b0ea3a9f59 100644 --- a/src/interfaces/odbc/statement.c +++ b/src/interfaces/odbc/statement.c @@ -1,4 +1,3 @@ - /* Module: statement.c * * Description: This module contains functions related to creating diff --git a/src/interfaces/odbc/tuple.c b/src/interfaces/odbc/tuple.c index 303476fef2..968f098a80 100644 --- a/src/interfaces/odbc/tuple.c +++ b/src/interfaces/odbc/tuple.c @@ -1,4 +1,3 @@ - /* Module: tuple.c * * Description: This module contains functions for setting the data for individual diff --git a/src/interfaces/odbc/tuplelist.c b/src/interfaces/odbc/tuplelist.c index 31acb9c9c9..75110896a7 100644 --- a/src/interfaces/odbc/tuplelist.c +++ b/src/interfaces/odbc/tuplelist.c @@ -1,4 +1,3 @@ - /* Module: tuplelist.c * * Description: This module contains functions for creating a manual result set -- 2.40.0