From 44c11601378edc6d94b93b14ea33e12eb0652646 Mon Sep 17 00:00:00 2001 From: prabatuty Date: Wed, 2 Jul 2008 12:07:58 +0000 Subject: [PATCH] List.remove() gives error message when element is not found. Added flag which instructs the method to display error message or not. --- include/Util.h | 8 +++++--- src/odbc/Makefile | 18 +++++++++--------- src/server/DatabaseManagerImpl.cxx | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/Util.h b/include/Util.h index 5313c2c8..a06d334e 100644 --- a/include/Util.h +++ b/include/Util.h @@ -94,11 +94,12 @@ class List } //Warning:Try to avoid using this method while using the iterator.The behavior //is undefined. Instead set flag isRemove to yes and call nextElement of iterator. - DbRetVal remove(void *elem) + DbRetVal remove(void *elem, bool err=true) { if (NULL == head) { - printError(ErrNotExists, "There are no elements in the list. Empty list"); + if (err) + printError(ErrNotExists, "There are no elements in the list. Empty list"); return ErrNotExists; } ListNode *iter = head, *prev = head; @@ -115,7 +116,8 @@ class List prev = iter; iter = iter->next; } - printError(ErrNotFound, "There are no elements in the list"); + if (err) + printError(ErrNotFound, "There are no elements in the list"); return ErrNotFound; } diff --git a/src/odbc/Makefile b/src/odbc/Makefile index 4c2c6834..c4d2ee08 100644 --- a/src/odbc/Makefile +++ b/src/odbc/Makefile @@ -77,14 +77,14 @@ HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/csql/latest/compkey/csql/missing --run aclocal-1.9 +ACLOCAL = ${SHELL} /home/praba/csql/latest/test/csql/missing --run aclocal-1.9 AMDEP_FALSE = # AMDEP_TRUE = -AMTAR = ${SHELL} /home/csql/latest/compkey/csql/missing --run tar +AMTAR = ${SHELL} /home/praba/csql/latest/test/csql/missing --run tar AR = ar -AUTOCONF = ${SHELL} /home/csql/latest/compkey/csql/missing --run autoconf -AUTOHEADER = ${SHELL} /home/csql/latest/compkey/csql/missing --run autoheader -AUTOMAKE = ${SHELL} /home/csql/latest/compkey/csql/missing --run automake-1.9 +AUTOCONF = ${SHELL} /home/praba/csql/latest/test/csql/missing --run autoconf +AUTOHEADER = ${SHELL} /home/praba/csql/latest/test/csql/missing --run autoheader +AUTOMAKE = ${SHELL} /home/praba/csql/latest/test/csql/missing --run automake-1.9 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -94,7 +94,7 @@ CPPFLAGS = CXX = g++ CXXCPP = g++ -E CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -I/opt/java/jdk1.6.0_04/include -I/opt/java/jdk1.6.0_04/include/linux +CXXFLAGS = -g -I/home/praba/csql/jdk1.5.0_14/include -I/home/praba/csql/jdk1.5.0_14/include/linux CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps @@ -120,7 +120,7 @@ LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s LTLIBOBJS = -MAKEINFO = ${SHELL} /home/csql/latest/compkey/csql/missing --run makeinfo +MAKEINFO = ${SHELL} /home/praba/csql/latest/test/csql/missing --run makeinfo OBJEXT = o PACKAGE = csql PACKAGE_BUGREPORT = @@ -167,7 +167,7 @@ host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = /home/csql/latest/compkey/csql/install-sh +install_sh = /home/praba/csql/latest/test/csql/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -176,7 +176,7 @@ mandir = ${datarootdir}/man mkdir_p = mkdir -p -- oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /home/csql/latest/compkey/csql/install +prefix = /home/praba/csql/latest/test/csql/install program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin diff --git a/src/server/DatabaseManagerImpl.cxx b/src/server/DatabaseManagerImpl.cxx index 9f0777f3..32b14094 100644 --- a/src/server/DatabaseManagerImpl.cxx +++ b/src/server/DatabaseManagerImpl.cxx @@ -734,7 +734,7 @@ void DatabaseManagerImpl::closeTable(Table *table) printDebug(DM_Database,"Closing table handle: %x", table); if (NULL == table) return; //table->unlock(); - tableList.remove(table); + tableList.remove(table, false); delete table; logFinest(logger, "Closing Table"); } -- 2.11.4.GIT