On 2017-11-15 07:19, [ext] Jan Kiszka wrote: > On 2017-11-14 14:22, [ext] Andreas J. Reichel wrote: >> From: Andreas Reichel <[email protected]> >> >> Make negative return values in environment setters consistent. >> >> Signed-off-by: Andreas Reichel <[email protected]> >> --- >> env/env_api.c | 6 +++--- >> tools/bg_setenv.c | 2 +- >> 2 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/env/env_api.c b/env/env_api.c >> index bd034af..ea55bad 100644 >> --- a/env/env_api.c >> +++ b/env/env_api.c >> @@ -171,7 +171,7 @@ int ebg_env_setglobalstate(ebgenv_t *e, uint16_t ustate) >> int res; >> >> if (ustate > USTATE_FAILED) { >> - return EINVAL; >> + return -EINVAL; >> } >> (void)snprintf(buffer, sizeof(buffer), "%d", ustate); >> res = bgenv_set((BGENV *)e->bgenv, "ustate", 0, buffer, >> @@ -190,10 +190,10 @@ int ebg_env_setglobalstate(ebgenv_t *e, uint16_t >> ustate) >> env->data->ustate = ustate; >> if (!bgenv_write(env)) { >> (void)bgenv_close(env); >> - return EIO; >> + return -EIO; >> } >> if (!bgenv_close(env)) { >> - return EIO; >> + return -EIO; >> } >> } >> return 0; >> diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c >> index bc65c51..746d474 100644 >> --- a/tools/bg_setenv.c >> +++ b/tools/bg_setenv.c >> @@ -146,7 +146,7 @@ static void journal_process_action(BGENV *env, struct >> env_action *action) >> if ((ret = ebg_env_setglobalstate(&e, ustate)) != 0) { >> fprintf(stderr, >> "Error setting global state: %s.", >> - strerror(ret)); >> + strerror(-ret)); >> } >> return; >> } >> > > You also need to update the testcases, no? >
I've done that for you. Jan -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/252c148f-302b-4e85-440c-04d1ebb3e8cb%40siemens.com. For more options, visit https://groups.google.com/d/optout.
