1 |
commit: a78b18e291bd7f55b176958074f41327f2d0e196 |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Aug 28 19:23:46 2013 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 28 19:23:46 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a78b18e2 |
7 |
|
8 |
libeinfo: suppress output for eerror* functions |
9 |
|
10 |
This makes the eerror* functions honor the EINFO_QUIET environment |
11 |
variable like the einfo* and ewarn* functions. |
12 |
|
13 |
X-Gentoo-Bug: 482396 |
14 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482396 |
15 |
|
16 |
--- |
17 |
man/einfo.3 | 1 + |
18 |
src/libeinfo/libeinfo.c | 6 ++++-- |
19 |
2 files changed, 5 insertions(+), 2 deletions(-) |
20 |
|
21 |
diff --git a/man/einfo.3 b/man/einfo.3 |
22 |
index 0af12a8..31c4b68 100644 |
23 |
--- a/man/einfo.3 |
24 |
+++ b/man/einfo.3 |
25 |
@@ -107,6 +107,7 @@ respectively, but only work when |
26 |
is true. You can also make the |
27 |
.Fn einfo , |
28 |
.Fn ewarn , |
29 |
+.Fn eerror , |
30 |
and |
31 |
.Fn ebegin |
32 |
functions silent by setting |
33 |
|
34 |
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c |
35 |
index d27bdb2..7b1f2da 100644 |
36 |
--- a/src/libeinfo/libeinfo.c |
37 |
+++ b/src/libeinfo/libeinfo.c |
38 |
@@ -674,6 +674,8 @@ eerrorn(const char *EINFO_RESTRICT fmt, ...) |
39 |
int retval; |
40 |
va_list ap; |
41 |
|
42 |
+ if (!fmt || is_quiet()) |
43 |
+ return 0; |
44 |
va_start(ap, fmt); |
45 |
retval = _eerrorvn(fmt, ap); |
46 |
va_end(ap); |
47 |
@@ -740,7 +742,7 @@ eerror(const char *EINFO_RESTRICT fmt, ...) |
48 |
int retval; |
49 |
va_list ap; |
50 |
|
51 |
- if (!fmt) |
52 |
+ if (!fmt || is_quiet()) |
53 |
return 0; |
54 |
va_start(ap, fmt); |
55 |
elogv(LOG_ERR, fmt, ap); |
56 |
@@ -757,7 +759,7 @@ eerrorx(const char *EINFO_RESTRICT fmt, ...) |
57 |
{ |
58 |
va_list ap; |
59 |
|
60 |
- if (fmt) { |
61 |
+ if (fmt && !is_quiet()) { |
62 |
va_start(ap, fmt); |
63 |
elogv(LOG_ERR, fmt, ap); |
64 |
_eerrorvn(fmt, ap); |