Commit 182ac80f authored by Pavel Vainerman's avatar Pavel Vainerman

Глобально в gettimeofday убрал использование timezone (т.к. не требуется).

parent 7d51a102
......@@ -201,8 +201,7 @@ void DBServer_MySQL::sensorInfo( const UniSetTypes::SensorMessage* si )
// если время не было выставлено (указываем время сохранения в БД)
if( !si->tm.tv_sec )
{
struct timezone tz;
gettimeofday( const_cast<struct timeval*>(&si->tm), &tz);
gettimeofday( const_cast<struct timeval*>(&si->tm), NULL);
}
float val = (float)si->value / (float)pow10(si->ci.precision);
......
......@@ -184,8 +184,7 @@ void DBServer_SQLite::sensorInfo( const UniSetTypes::SensorMessage* si )
// если время не было выставлено (указываем время сохранения в БД)
if( !si->tm.tv_sec )
{
struct timezone tz;
gettimeofday(const_cast<struct timeval*>(&si->tm), &tz);
gettimeofday(const_cast<struct timeval*>(&si->tm), NULL);
}
float val = (float)si->value / (float)pow10(si->ci.precision);
......
......@@ -358,8 +358,7 @@ class SharedMemory:
fuse_sec(0), fuse_usec(0)
{
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
gettimeofday(&tv, NULL);
fuse_sec = tv.tv_sec;
fuse_usec = tv.tv_usec;
}
......
......@@ -305,10 +305,9 @@ void IOController::localSetValue( std::shared_ptr<USensorInfo>& usi,
// запоминаем время изменения
struct timeval tm = { 0 };
struct timezone tz;
tm.tv_sec = 0;
tm.tv_usec = 0;
gettimeofday(&tm, &tz);
gettimeofday(&tm, NULL);
usi->tv_sec = tm.tv_sec;
usi->tv_usec = tm.tv_usec;
}
......@@ -378,10 +377,9 @@ void IOController::ioRegistration( std::shared_ptr<USensorInfo>& usi, bool force
IOStateList::mapped_type ai = usi;
// запоминаем начальное время
struct timeval tm;
struct timezone tz;
tm.tv_sec = 0;
tm.tv_usec = 0;
gettimeofday(&tm, &tz);
gettimeofday(&tm,NULL);
ai->tv_sec = tm.tv_sec;
ai->tv_usec = tm.tv_usec;
ai->value = ai->default_val;
......
......@@ -646,10 +646,9 @@ bool IONotifyController::addThreshold( ThresholdExtList& lst, ThresholdInfoExt&&
// запоминаем начальное время
struct timeval tm;
struct timezone tz;
tm.tv_sec = 0;
tm.tv_usec = 0;
gettimeofday(&tm, &tz);
gettimeofday(&tm, NULL);
ti.tv_sec = tm.tv_sec;
ti.tv_usec = tm.tv_usec;
......@@ -713,10 +712,9 @@ void IONotifyController::checkThreshold( std::shared_ptr<IOController::USensorIn
// текущее время
struct timeval tm;
struct timezone tz;
tm.tv_sec = 0;
tm.tv_usec = 0;
gettimeofday(&tm, &tz);
gettimeofday(&tm, NULL);
{
uniset_rwmutex_rlock l(ti->mut);
......
......@@ -56,10 +56,9 @@ namespace UniSetTypes
supplier(DefaultObjectId),
consumer(DefaultObjectId)
{
struct timezone tz;
tm.tv_sec = 0;
tm.tv_usec = 0;
gettimeofday(&tm, &tz);
gettimeofday(&tm,NULL);
}
/*
......
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