void PasswordFile::resetTimer()
{
- m_retryTimerStart = std::chrono::monotonic_clock::now();
+ m_retryTimerStart = ClockType::now();
m_retryTimerStart -= TimeDiff(RETRY_TIMEOUT);
}
} else {
m_passwordCurrent.reset(new SHA256Password(oldFormatPasswords.front().m_hash));
std::for_each(++oldFormatPasswords.begin(), oldFormatPasswords.end(),
- [&m_passwordHistory] (const OldPassword& pwd)
+ [&] (const OldPassword& pwd)
{m_passwordHistory.push_back(IPasswordPtr(new SHA256Password(pwd.m_hash)));}
);
}
bool PasswordFile::isIgnorePeriod() const
{
- TimePoint retryTimerStop = std::chrono::monotonic_clock::now();
+ TimePoint retryTimerStop = ClockType::now();
TimeDiff diff = retryTimerStop - m_retryTimerStart;
m_retryTimerStart = retryTimerStop;
bool isHistoryActive() const;
private:
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7))
+ typedef std::chrono::steady_clock ClockType;
+#else
+ typedef std::chrono::monotonic_clock ClockType;
+#endif
typedef std::chrono::duration<double> TimeDiff;
- typedef std::chrono::time_point<std::chrono::monotonic_clock, TimeDiff> TimePoint;
+ typedef std::chrono::time_point<ClockType, TimeDiff> TimePoint;
void loadMemoryFromFile();
bool tryLoadMemoryFromOldFormatFile();