Skip to content
Snippets Groups Projects
Commit 2925f507 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed HC crash on docker (bug 558427)


Change-Id: I1351ae3146a7f389ca3752f7f3fba1751a95e598
Signed-off-by: default avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 05ce31ea
No related branches found
No related tags found
No related merge requests found
......@@ -458,6 +458,11 @@ char *TTCN_Logger::mputstr_timestamp(char *str,
time_t tv_sec = tv->tv_sec;
struct tm *lt = localtime(&tv_sec);
if (lt == NULL) fatal_error("localtime() call failed.");
if (errno != 0) {
// HACK: 'localtime' may set the 'errno' on some systems (even though it
// succeeds); make sure this doesn't affect other code
errno = 0;
}
if (p_timestamp_format == TIMESTAMP_TIME) {
str = mputprintf(str, "%02d:%02d:%02d.%06ld",
lt->tm_hour, lt->tm_min, lt->tm_sec, tv->tv_usec);
......
......@@ -3019,7 +3019,6 @@ void TTCN_Runtime::wait_terminated_processes()
// this function might be called from TCs too while returning from
// TTCN_Communication::process_all_messages_hc() after fork()
if (!is_hc()) return;
errno = 0;
for ( ; ; ) {
int statuscode;
#ifdef __clang__
......@@ -3028,6 +3027,7 @@ void TTCN_Runtime::wait_terminated_processes()
struct rusage r_usage = {{0,0},{0,0},0,0,0,0,0,0,0,0,0,0,0,0,0,0};
#endif
errno = 0;
#ifdef INTERIX
pid_t child_pid = waitpid(-1, &statuscode, WNOHANG);
getrusage(RUSAGE_CHILDREN, &r_usage);
......
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