cmd: correct return value for printenv -e

If printenv -e is executed and the specified variable is not found, the
return value $? of the command should be 1 (false).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt 2022-06-19 13:36:48 +02:00
parent eaa268589e
commit a872b18a0f

View file

@ -182,8 +182,10 @@ static int efi_dump_var_all(int argc, char *const argv[],
}
free(var_name16);
if (!match && argc == 1)
if (!match && argc == 1) {
printf("Error: \"%s\" not defined\n", argv[0]);
return CMD_RET_FAILURE;
}
return CMD_RET_SUCCESS;
}