[PATCH 10/10] logger: make --stderr print remote server messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Users wish to see the message should include also remote messages, not
only the one sent to locally via libc function.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 misc-utils/logger.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 5c75d71..55c7cef 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -317,6 +317,8 @@ static void syslog_rfc3164(struct logger_ctl *ctl, char *msg)
 		 ctl->pri, tp, cp, pid, msg);
 	if (write_all(ctl->fd, buf, strlen(buf) + 1) < 0)
 		warn(_("write failed"));
+	if (ctl->logflags & LOG_PERROR)
+		fprintf(stderr, "%s\n", buf);
 }
 
 static void syslog_rfc5424(struct logger_ctl *ctl, char *msg)
@@ -374,6 +376,8 @@ static void syslog_rfc5424(struct logger_ctl *ctl, char *msg)
 	if (write_all(ctl->fd, buf, strlen(buf) + 1) < 0)
 		warn(_("write failed"));
 	free(hostname);
+	if (ctl->logflags & LOG_PERROR)
+		fprintf(stderr, "%s\n", buf);
 	free(buf);
 }
 
-- 
2.0.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux