logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: becc35843b87705633a977f4d7796af9f005e84d
parent 1eb67e5fd1f6c6131ac7c43a481007045b750f79
Author: fosslinux <fosslinux@aussies.space>
Date:   Fri, 12 Feb 2021 17:41:37 +1100

Merge pull request #38 from pder/musl-stdio-fix

musl: Force line buffering when writing to stdout

Diffstat:

Asysa/musl-1.1.24/patches/stdout_force_line_buffering.patch21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/sysa/musl-1.1.24/patches/stdout_force_line_buffering.patch b/sysa/musl-1.1.24/patches/stdout_force_line_buffering.patch @@ -0,0 +1,21 @@ +SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com> + +SPDX-License-Identifier: MIT + +Force writing to stdout to use line buffering. Works around problem +with pipes and redirecting stdout. + +--- src/stdio/__stdout_write.c ++++ src/stdio/__stdout_write.c +@@ -5,7 +5,6 @@ size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len) + { + struct winsize wsz; + f->write = __stdio_write; +- if (!(f->flags & F_SVB) && __syscall(SYS_ioctl, f->fd, TIOCGWINSZ, &wsz)) +- f->lbf = -1; ++ f->lbf = '\n'; + return __stdio_write(f, buf, len); + } +-- +2.30.0 +