From: Maxim Mamontov Date: Tue, 19 Jul 2016 17:42:17 +0000 (+0300) Subject: Merge branch 'stg-2.409' X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/5ac9b6c2949b075cbb8d8c91dd9f603f3f8ad0a3?hp=980332313bffde590173f76fd006837e0c8f3bed Merge branch 'stg-2.409' --- diff --git a/.gitignore b/.gitignore index ea5489c2..0b882f23 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,6 @@ Makefile.conf projects/convertor/convertor projects/rscriptd/rscriptd projects/sgconf/sgconf +projects/sgconf_xml/sgconf_xml doc/xmlrpc-doc/book doc/help/book diff --git a/projects/sgconv/build b/projects/sgconv/build index 1bc23718..3c2f3f91 100755 --- a/projects/sgconv/build +++ b/projects/sgconv/build @@ -72,7 +72,6 @@ printf " Building sgconv for $sys $release\n" printf "#############################################################################\n" STG_LIBS="logger.lib - locker.lib crypto.lib common.lib conffiles.lib diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp index f012fa1a..f5a57a48 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp @@ -83,7 +83,6 @@ int CONFIGPROTO::Prepare() sigaddset(&sigmask, SIGUSR1); sigaddset(&sigmask, SIGHUP); pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask); - m_listenSocket = socket(PF_INET, SOCK_STREAM, 0); if (m_listenSocket < 0) diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp index 5e61cabb..138a9ed9 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp @@ -31,6 +31,13 @@ #include "firebird_store.h" #include "stg/ibpp.h" +namespace +{ + +const int pt_mega = 1024 * 1024; + +} + //----------------------------------------------------------------------------- int FIREBIRD_STORE::GetTariffsList(std::vector * tariffsList) const { @@ -304,8 +311,8 @@ try st->Get(7, td->dirPrice[dir].priceNightB); td->dirPrice[dir].priceNightB /= 1024*1024; st->Get(8, td->dirPrice[dir].threshold); - if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 && - std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3) + if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 / pt_mega && + std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3 / pt_mega) { td->dirPrice[dir].singlePrice = true; } diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp index dabc06db..045411b1 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp @@ -36,6 +36,13 @@ #include "postgresql_store.h" #include "stg/locker.h" +namespace +{ + +const int pt_mega = 1024 * 1024; + +} + //----------------------------------------------------------------------------- int POSTGRESQL_STORE::GetTariffsList(std::vector * tariffsList) const { @@ -568,8 +575,8 @@ for (int i = 0; i < std::min(tuples, DIR_NUM); ++i) tuple >> td->dirPrice[dir].mNight; } - if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) > 1.0e-3 && - std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) > 1.0e-3) + if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 / pt_mega && + std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3 / pt_mega) { td->dirPrice[dir].singlePrice = true; } diff --git a/projects/stargazer/settings_impl.h b/projects/stargazer/settings_impl.h index ec8c9cb1..20d82869 100644 --- a/projects/stargazer/settings_impl.h +++ b/projects/stargazer/settings_impl.h @@ -42,7 +42,6 @@ #include "stg/settings.h" #include "stg/common.h" -#include "stg/logger.h" #include "stg/module_settings.h" //----------------------------------------------------------------------------- diff --git a/stglibs/pinger.lib/Makefile b/stglibs/pinger.lib/Makefile index c8c09b3e..803f7ac4 100644 --- a/stglibs/pinger.lib/Makefile +++ b/stglibs/pinger.lib/Makefile @@ -10,8 +10,7 @@ INCS = pinger.h LIBS = $(LIB_THREAD) -LIB_INCS = -I ../locker.lib/include \ - -I ../common.lib/include +LIB_INCS = -I ../common.lib/include include ../Makefile.in