Commit 46dae9ad authored by Pavel Vainerman's avatar Pavel Vainerman

(UniSetTimer): Небольшие изменения в функциях millisecToPoco() and microsecToPoco()

(UniSetActivator): подправил логи при stacktrace
parent f84f65dc
......@@ -14,7 +14,7 @@
Name: libuniset2
Version: 2.5
Release: alt12
Release: alt13
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
......@@ -486,6 +486,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
%changelog
* Fri Sep 09 2016 Pavel Vainerman <pv@altlinux.ru> 2.5-alt13
- minor fixes in millisecToPoco() and microsecToPoco() functions
* Thu Sep 08 2016 Pavel Vainerman <pv@altlinux.ru> 2.5-alt12
- up build
......
......@@ -234,10 +234,12 @@ bool gdb_print_trace()
if( g_act && !g_act->getAbortScript().empty() )
{
TRACELOG << "run script: " << g_act->getAbortScript() << " for stack trace: proc " << name_buf << " pid=" << pid_buf << endl;
execlp(g_act->getAbortScript().c_str(), g_act->getAbortScript().c_str(), name_buf, pid_buf, NULL);
}
else
{
TRACELOG << "direct run gdb for stack trace for pid=" << pid_buf << " name=" << name_buf << " ..." << endl;
// приходится выводить информацию по всем потокам, т.к. мы не знаем в каком сработал сигнал
// его надо смотреть по выводу "<signal handler called>"
execlp("gdb", "gdb", "--batch", "-n", "-ex", "thread apply all bt", name_buf, pid_buf, NULL);
......
......@@ -113,13 +113,8 @@ void UniSetTimer::stop()
//------------------------------------------------------------------------------
const Poco::Timespan UniSetTimer::millisecToPoco( const timeout_t msec )
{
#ifdef POCO_OLD_VERSION
if( msec == WaitUpTime )
return Poco::Timespan(std::numeric_limits<Poco::Timestamp::TimeVal>::max(),0);
#else
if( msec == WaitUpTime )
return Poco::Timespan(Poco::Timestamp::TIMEVAL_MAX,0);
#endif
return Poco::Timespan(-1,0);
// msec --> usec
return Poco::Timespan( long(msec/1000), long((msec*1000)%1000000) );
......@@ -127,13 +122,8 @@ const Poco::Timespan UniSetTimer::millisecToPoco( const timeout_t msec )
//------------------------------------------------------------------------------
const Poco::Timespan UniSetTimer::microsecToPoco( const timeout_t usec )
{
#ifdef POCO_OLD_VERSION
if( usec == WaitUpTime )
return Poco::Timespan(std::numeric_limits<Poco::Timestamp::TimeVal>::max(),0);
#else
if( usec == WaitUpTime )
return Poco::Timespan(Poco::Timestamp::TIMEVAL_MAX,0);
#endif
return Poco::Timespan(-1,0);
return Poco::Timespan( long(usec/1000000), long(usec%1000000) );
}
......
......@@ -109,6 +109,7 @@ TEST_CASE("UniSetTimer: conv to Poco", "[PassiveTimer][poco]" )
Poco::Timespan tm = UniSetTimer::millisecToPoco(UniSetTimer::WaitUpTime);
REQUIRE( tm.seconds() == -1 );
REQUIRE( tm.microseconds() == 0 );
REQUIRE( tm.totalMilliseconds() < 0 );
}
{
......@@ -124,6 +125,7 @@ TEST_CASE("UniSetTimer: conv to Poco", "[PassiveTimer][poco]" )
Poco::Timespan tm = UniSetTimer::microsecToPoco(UniSetTimer::WaitUpTime);
REQUIRE( tm.seconds() == -1 );
REQUIRE( tm.microseconds() == 0 );
REQUIRE( tm.totalMilliseconds() < 0 );
}
{
Poco::Timespan tm = UniSetTimer::microsecToPoco(2000000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment