Replace strerror_r with mxs_strerror

The mxs_strerror function requires no local buffer, thus making it simpler
and cleaner to use.
This commit is contained in:
Markus Mäkelä
2017-03-07 12:18:53 +02:00
parent d7e48f93bb
commit e1a1959bc2
33 changed files with 174 additions and 337 deletions

View File

@ -1129,7 +1129,6 @@ static bool ensure_dir_ok(const char* path, int mode)
if (path)
{
char err[MXS_STRERROR_BUFLEN];
char resolved[PATH_MAX + 1];
const char *rp = realpath(path, resolved);
@ -1150,19 +1149,19 @@ static bool ensure_dir_ok(const char* path, int mode)
else
{
MXS_ERROR("Failed to access directory '%s': %d, %s", rp,
errno, strerror_r(errno, err, sizeof(err)));
errno, mxs_strerror(errno));
}
}
else
{
MXS_ERROR("Failed to create directory '%s': %d, %s", rp,
errno, strerror_r(errno, err, sizeof(err)));
errno, mxs_strerror(errno));
}
}
else
{
MXS_ERROR("Failed to resolve real path name for '%s': %d, %s", path,
errno, strerror_r(errno, err, sizeof(err)));
errno, mxs_strerror(errno));
}
}