Skip to content
Snippets Groups Projects
Unverified Commit 4322b863 authored by Kristof Szabados's avatar Kristof Szabados Committed by GitHub
Browse files

Merge pull request #145 from GergoUjhelyi/master

Bug 563289 - Fixed timestamp problem after 2038
parents b8d555a1 0ec400ac
No related branches found
No related tags found
No related merge requests found
......@@ -405,7 +405,7 @@ boolean LegacyLogger::log_console(const TitanLoggerApi::TitanLogEvent& event,
return FALSE;
}
size_t event_str_len = mstrlen(event_str);
if (!TTCN_Communication::send_log((time_t)event.timestamp__().seconds(),
if (!TTCN_Communication::send_log((time_t)event.timestamp__().seconds().get_long_long_val(),
(suseconds_t)event.timestamp__().microSeconds(), severity,
event_str_len, event_str)) {
// The event text shall be printed to stderr when there is no control
......@@ -1774,7 +1774,7 @@ char *event_to_str(const TitanLoggerApi::TitanLogEvent& event,
{
char *ret_val = NULL;
if (!without_header) {
struct timeval timestamp = { (time_t)event.timestamp__().seconds(),
struct timeval timestamp = { (time_t)event.timestamp__().seconds().get_long_long_val(),
(suseconds_t)event.timestamp__().microSeconds() };
char *sourceinfo = NULL;
if (event.sourceInfo__list().is_bound()) {
......
......@@ -532,7 +532,8 @@ void LoggerPluginManager::fill_common_fields(API::TitanLogEvent& event,
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0)
TTCN_Logger::fatal_error("The gettimeofday() system call failed.");
event.timestamp__() = API::TimestampType(tv.tv_sec, tv.tv_usec);
event.timestamp__().seconds().set_long_long_val(tv.tv_sec);
event.timestamp__().microSeconds()=tv.tv_usec;
TTCN_Logger::source_info_format_t source_info_format =
TTCN_Logger::get_source_info_format();
API::TitanLogEvent_sourceInfo__list& srcinfo = event.sourceInfo__list();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment