From: Francesco Chemolli Date: Fri, 5 Oct 2012 13:10:15 +0000 (+0200) Subject: Shuffled fatal family of functions into own implementation. X-Git-Tag: SQUID_3_3_0_1~29^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f0a1fe79cb4246172ce3db07dbec257b7b4cb80;p=thirdparty%2Fsquid.git Shuffled fatal family of functions into own implementation. Created stub for fatal.cc. Move all files to src/ due to their dependencies. --- diff --git a/lib/Makefile.am b/lib/Makefile.am index a0a9840e71..9130138799 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -69,8 +69,7 @@ libmiscutil_la_SOURCES = \ Splay.cc \ stub_memaccount.c \ util.c \ - xusleep.c \ - fatal.cc + xusleep.c # $(top_srcdir)/include/version.h should be a dependency libsspwin32_la_SOURCES = \ diff --git a/src/Makefile.am b/src/Makefile.am index 926a931929..935d2c9ca6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -342,6 +342,8 @@ squid_SOURCES = \ ExternalACLEntry.h \ FadingCounter.h \ FadingCounter.cc \ + fatal.h \ + fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -1116,6 +1118,8 @@ tests_testHttpReply_SOURCES=\ cbdata.cc \ cbdata.h \ ETag.cc \ + fatal.h \ + tests/stub_fatal.cc \ HttpBody.h \ HttpBody.cc \ HttpHeaderFieldStat.h \ @@ -1217,6 +1221,8 @@ tests_testACLMaxUserIP_SOURCES= \ DiskIO/WriteRequest.cc \ ETag.cc \ event.cc \ + fatal.h \ + tests/stub_fatal.cc \ FileMap.h \ filemap.cc \ HelperChildConfig.h \ @@ -1423,6 +1429,8 @@ tests_testCacheManager_SOURCES = \ event.cc \ external_acl.cc \ ExternalACLEntry.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -1616,6 +1624,8 @@ tests_testDiskIO_SOURCES = \ ETag.cc \ EventLoop.cc \ event.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ FileMap.h \ @@ -1821,6 +1831,8 @@ tests_testEvent_SOURCES = \ external_acl.cc \ ExternalACLEntry.cc \ FadingCounter.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -2061,6 +2073,8 @@ tests_testEventLoop_SOURCES = \ external_acl.cc \ ExternalACLEntry.cc \ FadingCounter.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -2298,6 +2312,8 @@ tests_test_http_range_SOURCES = \ external_acl.cc \ ExternalACLEntry.cc \ FadingCounter.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -2586,6 +2602,8 @@ tests_testHttpRequest_SOURCES = \ ETag.cc \ external_acl.cc \ ExternalACLEntry.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -2775,6 +2793,8 @@ tests_testStore_SOURCES= \ ETag.cc \ event.cc \ EventLoop.cc \ + fatal.h \ + tests/stub_fatal.cc \ FileMap.h \ filemap.cc \ HttpHeaderFieldStat.h \ @@ -3001,6 +3021,8 @@ tests_testUfs_SOURCES = \ store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ client_db.h \ @@ -3162,6 +3184,8 @@ tests_testRock_SOURCES = \ ETag.cc \ EventLoop.cc \ event.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ FileMap.h \ @@ -3320,6 +3344,8 @@ tests_testCoss_SOURCES = \ store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ disk.h \ @@ -3655,6 +3681,8 @@ tests_testURL_SOURCES = \ event.cc \ external_acl.cc \ ExternalACLEntry.cc \ + fatal.h \ + tests/stub_fatal.cc \ fd.h \ fd.cc \ fde.cc \ @@ -3856,6 +3884,8 @@ tests_testConfigParser_SOURCES = \ MemBuf.cc \ String.cc \ ConfigParser.cc \ + fatal.h \ + tests/stub_fatal.cc \ tests/testMain.cc \ tests/testConfigParser.cc \ tests/testConfigParser.h \ diff --git a/lib/fatal.cc b/src/fatal.cc similarity index 100% rename from lib/fatal.cc rename to src/fatal.cc diff --git a/include/fatal.h b/src/fatal.h similarity index 100% rename from include/fatal.h rename to src/fatal.h diff --git a/src/tests/stub_fatal.cc b/src/tests/stub_fatal.cc new file mode 100644 index 0000000000..89241ccb0c --- /dev/null +++ b/src/tests/stub_fatal.cc @@ -0,0 +1,39 @@ +/* + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" + +#define STUB_API "fatal.cc" +#include "tests/STUB.h" + +void fatal(const char *message) STUB +void fatal_common(const char *message) STUB +void fatalf(const char *fmt,...) STUB +void fatalvf(const char *fmt, va_list args) STUB +void fatal_dump(const char *message) STUB diff --git a/src/tests/stub_tools.cc b/src/tests/stub_tools.cc index 2c3e1a312d..4c0af9d038 100644 --- a/src/tests/stub_tools.cc +++ b/src/tests/stub_tools.cc @@ -17,11 +17,6 @@ void PrintRusage(void) STUB void death(int sig) STUB void BroadcastSignalIfAny(int& sig) STUB void sigusr2_handle(int sig) STUB -void fatal(const char *message) STUB -void fatal_common(const char *message) STUB -void fatalf(const char *fmt,...) STUB -void fatalvf(const char *fmt, va_list args) STUB -void fatal_dump(const char *message) STUB void debug_trap(const char *message) STUB void sig_child(int sig) STUB void sig_shutdown(int sig) STUB diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am index e47b659e2c..5818f3502b 100644 --- a/test-suite/Makefile.am +++ b/test-suite/Makefile.am @@ -53,7 +53,7 @@ check_PROGRAMS += debug \ tcp_banger2_LDADD = $(top_builddir)/lib/libmiscutil.la -DEBUG_SOURCE = test_tools.cc stub_debug.cc stub_tools.cc +DEBUG_SOURCE = test_tools.cc stub_debug.cc stub_tools.cc stub_fatal.cc stub_debug.cc: $(top_srcdir)/src/tests/stub_debug.cc cp $(top_srcdir)/src/tests/stub_debug.cc . @@ -61,7 +61,10 @@ stub_debug.cc: $(top_srcdir)/src/tests/stub_debug.cc stub_tools.cc: $(top_srcdir)/src/tests/stub_tools.cc cp $(top_srcdir)/src/tests/stub_tools.cc . -CLEANFILES += stub_debug.cc stub_tools.cc +stub_fatal.cc: $(top_srcdir)/src/tests/stub_fatal.cc + cp $(top_srcdir)/src/tests/stub_fatal.cc . + +CLEANFILES += stub_debug.cc stub_tools.cc stub_fatal.cc ## XXX: somewhat broken. Its meant to test our debugs() implementation. ## but it has never been linked to the actual src/debug.cc implementation !!