summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-21 10:08:35 +0000
committerRoy Marples <roy@marples.name>2008-02-21 10:08:35 +0000
commit5bb09b65871362f60b7facd6193638caeba31a49 (patch)
tree4ee3b5390101e37d62cfae33e8baac50641312ed
parent405cea1f19eb4de00805eeb6bddd36184e51b400 (diff)
downloadopenrc-5bb09b65871362f60b7facd6193638caeba31a49.tar.gz
openrc-5bb09b65871362f60b7facd6193638caeba31a49.tar.bz2
openrc-5bb09b65871362f60b7facd6193638caeba31a49.tar.xz
ewarn now goes to stderr to match portage behaviour.
-rw-r--r--man/einfo.34
-rw-r--r--src/libeinfo/libeinfo.c14
2 files changed, 9 insertions, 9 deletions
diff --git a/man/einfo.3 b/man/einfo.3
index 631036a..07eb065 100644
--- a/man/einfo.3
+++ b/man/einfo.3
@@ -86,7 +86,9 @@ being green,
.Fn ewarn
being yellow and
.Fn eerror
-being red. The number of real characters printed is returned.
+being red.
+einfo goes to stdout and the others go to stderr.
+The number of real characters printed is returned.
.Fn ebegin
is identical to
.Fn einfo
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index e141438..ee5b8a6 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -601,7 +601,7 @@ static int _ewarnvn (const char *__EINFO_RESTRICT fmt, va_list ap)
{
int retval = 0;
- EINFOVN (stdout, ECOLOR_WARN);
+ EINFOVN (stderr, ECOLOR_WARN);
return (retval);
}
@@ -694,7 +694,7 @@ int ewarn (const char *__EINFO_RESTRICT fmt, ...)
va_start (ap, fmt);
elogv (LOG_WARNING, fmt, ap);
retval = _ewarnvn (fmt, ap);
- retval += printf ("\n");
+ retval += fprintf (stderr, "\n");
va_end (ap);
LASTCMD ("ewarn");
@@ -713,7 +713,7 @@ void ewarnx (const char *__EINFO_RESTRICT fmt, ...)
elogv (LOG_WARNING, fmt, ap);
retval = _ewarnvn (fmt, ap);
va_end (ap);
- retval += printf ("\n");
+ retval += fprintf (stderr, "\n");
}
exit (EXIT_FAILURE);
}
@@ -818,14 +818,12 @@ static int _do_eend (const char *cmd, int retval, const char *__EINFO_RESTRICT f
va_list apc;
if (fmt && *fmt != '\0' && retval != 0) {
+ fp = stderr;
va_copy (apc, ap);
- if (strcmp (cmd, "ewend") == 0) {
+ if (strcmp (cmd, "ewend") == 0)
col = _ewarnvn (fmt, apc);
- fp = stdout;
- } else {
+ else
col = _eerrorvn (fmt, apc);
- fp = stderr;
- }
col += fprintf (fp, "\n");
va_end (apc);
}