summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:41 +0100
committerKarel Zak2006-12-07 00:25:41 +0100
commiteb63b9b8f4cecb34c2478282567862bc48ef256d (patch)
tree99243f8eecb44c2bb6a559982b99c680fcb649e7 /misc-utils/logger.c
parentImported from util-linux-2.9v tarball. (diff)
downloadkernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.tar.gz
kernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.tar.xz
kernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.zip
Imported from util-linux-2.10f tarball.
Diffstat (limited to 'misc-utils/logger.c')
-rw-r--r--misc-utils/logger.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 4c881c968..9d848a660 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -210,6 +210,13 @@ main(argc, argv)
}
} else
while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ /* glibc is buggy and adds an additional newline,
+ so we have to remove it here until glibc is fixed */
+ int len = strlen(buf);
+
+ if (len > 0 && buf[len - 1] == '\n')
+ buf[len - 1] = '\0';
+
if (!usock)
syslog(pri, "%s", buf);
else