Exit when we can't print a variable.
Exit after printing a message on stderr when we can't get a message. This is slightly different than linux, but keeps shell scripts from thinking the value of the variable is the error message and so is a net win. Sponsored by: Netflix
This commit is contained in:
parent
589c673b32
commit
35a419a2cb
@ -205,21 +205,20 @@ print_var(efi_guid_t *guid, char *name)
|
|||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
efi_guid_to_str(guid, &gname);
|
efi_guid_to_str(guid, &gname);
|
||||||
if (!Nflag)
|
|
||||||
printf("%s-%s", gname, name);
|
|
||||||
if (pflag) {
|
if (pflag) {
|
||||||
rv = efi_get_variable(*guid, name, &data, &datalen, &att);
|
rv = efi_get_variable(*guid, name, &data, &datalen, &att);
|
||||||
|
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
printf("\n --- Error getting value --- %d", errno);
|
err(1, "%s-%s", gname, name);
|
||||||
else {
|
|
||||||
if (Aflag)
|
if (!Nflag)
|
||||||
asciidump(data, datalen);
|
printf("%s-%s", gname, name);
|
||||||
else if (bflag)
|
if (Aflag)
|
||||||
bindump(data, datalen);
|
asciidump(data, datalen);
|
||||||
else
|
else if (bflag)
|
||||||
hexdump(data, datalen);
|
bindump(data, datalen);
|
||||||
}
|
else
|
||||||
|
hexdump(data, datalen);
|
||||||
}
|
}
|
||||||
free(gname);
|
free(gname);
|
||||||
if (!Nflag)
|
if (!Nflag)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user