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

@@ -181,6 +181,8 @@ int ssl_init(void)
if ((fd = open("/dev/urandom", O_RDONLY)) == -1)
{
TFE_LOG_ERROR(NULL, "Error opening /dev/urandom for reading: %s", strerror(errno));
/* after log, reset errno */
errno = 0;
goto __errout;
}
@@ -189,6 +191,8 @@ int ssl_init(void)
if (read(fd, buf, sizeof(buf)) == -1)
{
TFE_LOG_ERROR(NULL, "Error reading from /dev/urandom: %s", strerror(errno));
/* after log, reset errno */
errno = 0;
goto __errout;
}