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

@ -147,7 +147,8 @@ void gw_daemonize(void) {
pid = fork();
if (pid < 0) {
fprintf(stderr, "fork() error %s\n", strerror(errno));
char errbuf[STRERROR_BUFLEN];
fprintf(stderr, "fork() error %s\n", strerror_r(errno, errbuf, sizeof(errbuf)));
exit(1);
}
@ -157,7 +158,8 @@ void gw_daemonize(void) {
}
if (setsid() < 0) {
fprintf(stderr, "setsid() error %s\n", strerror(errno));
char errbuf[STRERROR_BUFLEN];
fprintf(stderr, "setsid() error %s\n", strerror_r(errno, errbuf, sizeof(errbuf)));
exit(1);
}
}