From: Maxim Mamontov Date: Fri, 2 Aug 2013 19:25:08 +0000 (+0300) Subject: Merge branch 'master' into full-month-stats X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/9d4423c1adf360b1aa1503b2addcf3c1228cec7a?hp=d2b05df9aed6362e0e9f560d610108aaf3acdd19 Merge branch 'master' into full-month-stats --- diff --git a/projects/sgconf/Makefile b/projects/sgconf/Makefile index 297d3e20..09699122 100644 --- a/projects/sgconf/Makefile +++ b/projects/sgconf/Makefile @@ -41,7 +41,11 @@ OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += -Wl,-E $(STGLIBS_LIBS) +LDFLAGS += $(STGLIBS_LIBS) + +ifneq ($(OS),darwin) +LDFLAGS += -Wl,-E +endif .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data all: libs $(PROG) ../../Makefile.conf diff --git a/projects/sgconf/build b/projects/sgconf/build index 47706a94..d7b72363 100755 --- a/projects/sgconf/build +++ b/projects/sgconf/build @@ -51,6 +51,13 @@ then MAKE="gmake" fi +if [ "$sys" = "Darwin" ] +then + OS=darwin + ETC_DIR="./inst/freebsd/etc/stargazer" + MAKE="gmake" +fi + if [ "$OS" = "unknown" ] then printf "#############################################################################\n" @@ -77,12 +84,18 @@ else then DEFS="$DEFS -DFREE_BSD" else - DEFS="$DEFS -DFREE_BSD5" if [ "$OS" = "bsd7" ] then + DEFS="$DEFS -DFREE_BSD5" LIB_THREAD=-lpthread else - LIB_THREAD=-lc_r + if [ "$OS" == "darwin" ] + then + DEFS="$DEFS -DDARWIN" + LIB_THREAD=-lpthread + else + LIB_THREAD=-lc_r + fi fi fi fi diff --git a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp b/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp index 12d35aa6..72e7f73b 100644 --- a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp +++ b/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp @@ -289,7 +289,7 @@ strncpy(ifr.ifr_name, bd->iface.c_str(), sizeof(ifr.ifr_name)); if (ioctl(bd->fd, BIOCSBLEN, (caddr_t)&l) < 0) { errorStr = bd->iface + " BIOCSBLEN " + std::string(strerror(errno)); - logger("ioctl (BIOCSBLEN) error for interface '%s': %s", bd->iface, strerror(errno)); + logger("ioctl (BIOCSBLEN) error for interface '%s': %s", bd->iface.c_str(), strerror(errno)); printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str()); return -1; } @@ -297,7 +297,7 @@ if (ioctl(bd->fd, BIOCSBLEN, (caddr_t)&l) < 0) if (ioctl(bd->fd, BIOCSETIF, (caddr_t)&ifr) < 0) { errorStr = bd->iface + " BIOCSETIF " + std::string(strerror(errno)); - logger("ioctl (BIOCSETIF) error for interface '%s': %s", bd->iface, strerror(errno)); + logger("ioctl (BIOCSETIF) error for interface '%s': %s", bd->iface.c_str(), strerror(errno)); printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str()); return -1; } @@ -305,7 +305,7 @@ if (ioctl(bd->fd, BIOCSETIF, (caddr_t)&ifr) < 0) if (ioctl(bd->fd, BIOCIMMEDIATE, &im) < 0) { errorStr = bd->iface + " BIOCIMMEDIATE " + std::string(strerror(errno)); - logger("ioctl (BIOCIMMEDIATE) error for interface '%s': %s", bd->iface, strerror(errno)); + logger("ioctl (BIOCIMMEDIATE) error for interface '%s': %s", bd->iface.c_str(), strerror(errno)); printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str()); return -1; } diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index d5fab222..fb8cb57c 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -324,6 +324,9 @@ std::for_each(authorizedUsers.begin(), authorizedUsers.end(), UpdateRouter(*this)); +logger("%s reloaded successfully.", rsSettings.GetMapFileName().c_str()); +printfd(__FILE__, "REMOTE_SCRIPT::Reload() %s reloaded successfully.\n"); + return 0; } //----------------------------------------------------------------------------- diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/projects/stargazer/plugins/other/smux/smux.cpp index 31b91bb3..09cb4636 100644 --- a/projects/stargazer/plugins/other/smux/smux.cpp +++ b/projects/stargazer/plugins/other/smux/smux.cpp @@ -278,6 +278,11 @@ if (Stop()) return -1; if (Start()) return -1; +if (!needReconnect) + { + printfd(__FILE__, "SMUX reconnected succesfully.\n"); + logger("Reconnected successfully."); + } return 0; } diff --git a/projects/stargazer/traffcounter_impl.cpp b/projects/stargazer/traffcounter_impl.cpp index 17a786ff..fce47595 100644 --- a/projects/stargazer/traffcounter_impl.cpp +++ b/projects/stargazer/traffcounter_impl.cpp @@ -738,8 +738,8 @@ if (ReadRules(true)) FreeRules(); ReadRules(); -printfd(__FILE__, "TRAFFCOUNTER_IMPL::Reload() - Reload rules successfull.\n"); -WriteServLog("TRAFFCOUNTER: Reload rules successfull."); +printfd(__FILE__, "TRAFFCOUNTER_IMPL::Reload() - Reloaded rules successfully.\n"); +WriteServLog("TRAFFCOUNTER: Reloaded rules successfully."); return 0; } //-----------------------------------------------------------------------------