libeinfo: suppress output for eerror* functions
This makes the eerror* functions honor the EINFO_QUIET environment variable like the einfo* and ewarn* functions. X-Gentoo-Bug: 482396 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396
This commit is contained in:
parent
72b58b9e6b
commit
a78b18e291
@ -107,6 +107,7 @@ respectively, but only work when
|
|||||||
is true. You can also make the
|
is true. You can also make the
|
||||||
.Fn einfo ,
|
.Fn einfo ,
|
||||||
.Fn ewarn ,
|
.Fn ewarn ,
|
||||||
|
.Fn eerror ,
|
||||||
and
|
and
|
||||||
.Fn ebegin
|
.Fn ebegin
|
||||||
functions silent by setting
|
functions silent by setting
|
||||||
|
@ -674,6 +674,8 @@ eerrorn(const char *EINFO_RESTRICT fmt, ...)
|
|||||||
int retval;
|
int retval;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if (!fmt || is_quiet())
|
||||||
|
return 0;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
retval = _eerrorvn(fmt, ap);
|
retval = _eerrorvn(fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
@ -740,7 +742,7 @@ eerror(const char *EINFO_RESTRICT fmt, ...)
|
|||||||
int retval;
|
int retval;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
if (!fmt)
|
if (!fmt || is_quiet())
|
||||||
return 0;
|
return 0;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
elogv(LOG_ERR, fmt, ap);
|
elogv(LOG_ERR, fmt, ap);
|
||||||
@ -757,7 +759,7 @@ eerrorx(const char *EINFO_RESTRICT fmt, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
if (fmt) {
|
if (fmt && !is_quiet()) {
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
elogv(LOG_ERR, fmt, ap);
|
elogv(LOG_ERR, fmt, ap);
|
||||||
_eerrorvn(fmt, ap);
|
_eerrorvn(fmt, ap);
|
||||||
|
Loading…
Reference in New Issue
Block a user