 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/MUSL PATCH 2/3] Add patch to fflush after printing on stdout
 Please, ignore this patch. We found a better way to do it. We will send a new 
patch quite soon.
Gaulthier
> On 25 Feb 2020, at 13:49, gaulthier.gain@xxxxxxxxx wrote:
> 
> From: gaulthier gain <gaulthier.gain@xxxxxxxxx>
> 
> This patch fixes the issue where printing on stdout does
> nothing since stdout was not flushed. We found that all
> print-related functions call "puts" as an internal function
> to print output on the console. Therefore, we call fflush
> directly after the "puts" call.
> 
> Signed-off-by: gaulthier gain <gaulthier.gain@xxxxxxxxx>
> ---
> patches/0009-fflush-after-puts.patch | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
> create mode 100644 patches/0009-fflush-after-puts.patch
> 
> diff --git a/patches/0009-fflush-after-puts.patch 
> b/patches/0009-fflush-after-puts.patch
> new file mode 100644
> index 0000000..7f1e8dc
> --- /dev/null
> +++ b/patches/0009-fflush-after-puts.patch
> @@ -0,0 +1,25 @@
> +From aed4243e93e9327357f8429af3bf380739968e42 Mon Sep 17 00:00:00 2001
> +From: gaulthier gain <gaulthier.gain@xxxxxxxxx>
> +Date: Tue, 25 Feb 2020 11:55:58 +0000
> +Subject: [PATCH] Add fflush after puts in order to flush stdout
> +
> +Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
> +---
> + src/stdio/puts.c | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/src/stdio/puts.c b/src/stdio/puts.c
> +index 5a38a49..d19e5b6 100644
> +--- a/src/stdio/puts.c
> ++++ b/src/stdio/puts.c
> +@@ -5,6 +5,7 @@ int puts(const char *s)
> +     int r;
> +     FLOCK(stdout);
> +     r = -(fputs(s, stdout) < 0 || putc_unlocked('\n', stdout) < 0);
> ++    fflush(stdout);
> +     FUNLOCK(stdout);
> +     return r;
> + }
> +--
> +2.17.1
> +
> --
> 2.17.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |