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:
parent
c5f2a44360
commit
6b6ebd9f0d
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue