commit 10356a07c168425f4ba8ccad11396b47bfeda79b parent eaa5285d6896f669e76148d6e0646fa2d4080857 Author: sin <sin@2f30.org> Date: Mon, 12 Aug 2013 10:19:49 +0100 Ensure dmesg output on Linux has a terminating newline Diffstat:
M | linux/dmesg.c | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/linux/dmesg.c b/linux/dmesg.c @@ -38,5 +38,8 @@ dmesg_show(int fd, const void *buf, size_t n) } last = p[i++]; } + if (last != '\n') + if (write(fd, "\n", 1) != 1) + return -1; return 0; }