From: Jan Kiszka <[email protected]> Do not report success when there was none and consistently return 1 on errors, not sometimes errno and sometimes 1.
Signed-off-by: Jan Kiszka <[email protected]> --- tools/bg_setenv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c index 9056102..6a68ba4 100644 --- a/tools/bg_setenv.c +++ b/tools/bg_setenv.c @@ -629,13 +629,14 @@ static int dumpenv_to_file(char *envfilepath) { fprintf(stderr, "Error writing to output file: %s\n", strerror(errno)); - result = errno; + result = 1; + } else { + fprintf(stdout, "Output written to %s.\n", envfilepath); } if (fclose(of)) { fprintf(stderr, "Error closing output file.\n"); - result = errno; + result = 1; }; - fprintf(stdout, "Output written to %s.\n", envfilepath); } else { fprintf(stderr, "Error opening output file %s (%s).\n", envfilepath, strerror(errno)); -- 2.31.1 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/54ef1bf5-9864-94c7-eb5d-8e7e53226aa1%40siemens.com.
