after log error, reset errno

This commit is contained in:
luwenpeng
2020-07-30 15:57:34 +08:00
parent 7e2f36d416
commit 13289d5a71
10 changed files with 103 additions and 5 deletions

View File

@@ -311,6 +311,8 @@ int tfe_proxy_work_thread_run(struct tfe_proxy * proxy)
{
TFE_LOG_ERROR(proxy->logger, "Failed at pthread_create() for thread %d, error %d: %s", i, errno,
strerror(errno));
/* after log, reset errno */
errno = 0;
return -1;
}
}
@@ -527,6 +529,8 @@ static bool tfe_breakpad_dump_and_report(const google_breakpad::MinidumpDescript
{
fprintf(stderr, "Failed at exec the upload program %s: %s\n",
instance->upload_tools_filename, strerror(errno));
/* after log, reset errno */
errno = 0;
}
exit(EXIT_FAILURE);
@@ -540,6 +544,8 @@ static bool tfe_breakpad_dump_and_report(const google_breakpad::MinidumpDescript
{
/* failed at fork, cannot upload the minidump */
fprintf(stderr, "Failed at fork(), cannot upload minidump file. : %s\n", strerror(errno));
/* after log, reset errno */
errno = 0;
return succeeded;
}
}
@@ -592,6 +598,8 @@ int breakpad_init_minidump_upload(struct breakpad_instance * instance, const cha
if(unlikely(ret < 0))
{
TFE_LOG_ERROR(g_default_logger, "Failed at readlink /proc/self/exec: %s", strerror(errno));
/* after log, reset errno */
errno = 0;
goto errout;
}
@@ -637,6 +645,8 @@ struct breakpad_instance * breakpad_init(const char * profile)
if (ret < 0)
{
TFE_LOG_ERROR(g_default_logger, "setrlimit(RLIMIT_CORE, 0) failed: %s", strerror(errno));
/* after log, reset errno */
errno = 0;
}
}
@@ -672,6 +682,8 @@ struct breakpad_instance * breakpad_init(const char * profile)
if (ret < 0)
{
TFE_LOG_ERROR(g_default_logger, "setrlimit(RLIMIT_CORE, 0) failed: %s", strerror(errno));
/* after log, reset errno */
errno = 0;
}
}