MXS-251: strerror

Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
This commit is contained in:
Johan Wikman
2015-09-05 15:32:32 +03:00
parent a9fd7926ac
commit 160bbb70ee
31 changed files with 314 additions and 167 deletions

View File

@ -68,22 +68,24 @@ int setnonblocking(int fd) {
int fl;
if ((fl = fcntl(fd, F_GETFL, 0)) == -1) {
char errbuf[STRERROR_BUFLEN];
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Can't GET fcntl for %i, errno = %d, %s.",
fd,
errno,
strerror(errno))));
strerror_r(errno, errbuf, sizeof(errbuf)))));
return 1;
}
if (fcntl(fd, F_SETFL, fl | O_NONBLOCK) == -1) {
char errbuf[STRERROR_BUFLEN];
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Can't SET fcntl for %i, errno = %d, %s",
fd,
errno,
strerror(errno))));
strerror_r(errno, errbuf, sizeof(errbuf)))));
return 1;
}
return 0;