diff mbox series

[1/7] efi: Use puts() in cout so that console recording works

Message ID 20231121113557.800353-2-sjg@chromium.org
State RFC
Delegated to: Tom Rini
Headers show
Series efi: Partial attempt at a test for EFI bootmeth | expand

Commit Message

Simon Glass Nov. 21, 2023, 11:35 a.m. UTC
At present EFI output to the console use fputs() which bypasses the
console-recording feature. This makes it impossible for tests to check
the output of an EFI app.

There doesn't seem to be any need to do this bypass, so adjust it to
simply use the puts() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 lib/efi_loader/efi_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heinrich Schuchardt Nov. 21, 2023, 6:13 p.m. UTC | #1
On 11/21/23 12:35, Simon Glass wrote:
> At present EFI output to the console use fputs() which bypasses the
> console-recording feature. This makes it impossible for tests to check
> the output of an EFI app.
>
> There doesn't seem to be any need to do this bypass, so adjust it to
> simply use the puts() function.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>
>   lib/efi_loader/efi_console.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> index a2d137d7a9e1..28087582e8d6 100644
> --- a/lib/efi_loader/efi_console.c
> +++ b/lib/efi_loader/efi_console.c
> @@ -182,7 +182,7 @@ static efi_status_t EFIAPI efi_cout_output_string(
>   	}
>   	pos = buf;
>   	utf16_utf8_strcpy(&pos, string);
> -	fputs(stdout, buf);
> +	puts(buf);
>   	free(buf);
>
>   	/*
Ilias Apalodimas Nov. 21, 2023, 8:20 p.m. UTC | #2
On Tue, 21 Nov 2023 at 13:36, Simon Glass <sjg@chromium.org> wrote:
>
> At present EFI output to the console use fputs() which bypasses the

nit, use ->uses

> console-recording feature. This makes it impossible for tests to check
> the output of an EFI app.
>
> There doesn't seem to be any need to do this bypass, so adjust it to
> simply use the puts() function.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
>
>  lib/efi_loader/efi_console.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> index a2d137d7a9e1..28087582e8d6 100644
> --- a/lib/efi_loader/efi_console.c
> +++ b/lib/efi_loader/efi_console.c
> @@ -182,7 +182,7 @@ static efi_status_t EFIAPI efi_cout_output_string(
>         }
>         pos = buf;
>         utf16_utf8_strcpy(&pos, string);
> -       fputs(stdout, buf);
> +       puts(buf);
>         free(buf);
>
>         /*
> --
> 2.43.0.rc1.413.gea7ed67945-goog
>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index a2d137d7a9e1..28087582e8d6 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -182,7 +182,7 @@  static efi_status_t EFIAPI efi_cout_output_string(
 	}
 	pos = buf;
 	utf16_utf8_strcpy(&pos, string);
-	fputs(stdout, buf);
+	puts(buf);
 	free(buf);
 
 	/*