update grub_errno as per the return value
This commit is contained in:
parent
dc0fae73f8
commit
a0b5f6bcb1
1 changed files with 11 additions and 1 deletions
|
@ -621,7 +621,17 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd)
|
||||||
ret = grub_script_function_call (func, argc, args);
|
ret = grub_script_function_call (func, argc, args);
|
||||||
|
|
||||||
if (invert)
|
if (invert)
|
||||||
ret = ! ret;
|
{
|
||||||
|
if (ret == GRUB_ERR_TEST_FAILURE)
|
||||||
|
grub_errno = ret = GRUB_ERR_NONE;
|
||||||
|
else if (ret == GRUB_ERR_NONE)
|
||||||
|
ret = grub_error (GRUB_ERR_TEST_FAILURE, "false");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grub_print_error ();
|
||||||
|
grub_errno = ret = GRUB_ERR_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Free arguments. */
|
/* Free arguments. */
|
||||||
grub_script_argv_free (&argv);
|
grub_script_argv_free (&argv);
|
||||||
|
|
Loading…
Reference in a new issue