@@ -79,8 +79,10 @@ void semanage_msg_default_handler(void *varg __attribute__ ((unused)),
vfprintf(stream, fmt, ap);
va_end(ap);
- if (errsv && errsv != ENOMEM)
- fprintf(stream, " (%s).", strerror(errsv));
+ if (errsv && errsv != ENOMEM) {
+ errno = errsv;
+ fprintf(stream, " (%m).");
+ }
fprintf(stream, "\n");
}
@@ -739,8 +739,8 @@ static int semanage_rename(semanage_handle_t * sh, const char *src, const char *
return retval;
/* we can't use rename() due to filesystem limitation, lets try to copy files manually */
- WARN(sh, "WARNING: rename(%s, %s) failed: %s, fall back to non-atomic semanage_copy_dir_flags()",
- src, dst, strerror(errno));
+ WARN(sh, "WARNING: rename(%s, %s) failed: %m, fall back to non-atomic semanage_copy_dir_flags()",
+ src, dst);
if (semanage_copy_dir_flags(src, dst, 1) == -1) {
return -1;
}