logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: c2e5a1c01a74f25abfc9019a147b271f7d6cf52b
parent 1eb67e5fd1f6c6131ac7c43a481007045b750f79
Author: Paul Dersey <pdersey@gmail.com>
Date:   Thu, 11 Feb 2021 17:13:45 -0500

musl: Force line buffering when writing to stdout

This is a workaround for an issue in which binaries compiled with our
tcc+musl toolchain can fail to write complete output when stdout is
redirected to a file or pipe.

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 +