lib: Rework err_msg_n to output strerror after message

Outputting the message first followed by the strerror makes
the error messages more readable.

Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
John Kacur 2014-05-09 01:21:06 +02:00
parent c5f2a44360
commit 6b6ebd9f0d
2 changed files with 4 additions and 4 deletions

View File

@ -669,7 +669,7 @@ static int raise_soft_prio(int policy, const struct sched_param *param)
err = getrlimit(RLIMIT_RTPRIO, &rlim);
if (err) {
err = errno;
err_msg_n(err, "WARN: getrlimit failed\n");
err_msg_n(err, "WARN: getrlimit failed");
return err;
}
@ -681,7 +681,7 @@ static int raise_soft_prio(int policy, const struct sched_param *param)
err = setrlimit(RLIMIT_RTPRIO, &rlim);
if (err) {
err = errno;
err_msg_n(err, "WARN: setrlimit failed\n");
err_msg_n(err, "WARN: setrlimit failed");
/* return err; */
}
} else {

View File

@ -79,8 +79,8 @@ void fatal(char *fmt, ...)
void err_doit(int err, const char *fmt, va_list ap)
{
if (err)
fprintf(stderr, "%s\n", strerror(err));
vfprintf(stderr, fmt, ap);
if (err)
fprintf(stderr, ": %s\n", strerror(err));
return;
}