mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-21 19:26:22 +02:00
util/nvmutil: set errno only if x is not 0
otherwise, some minor edge cases may result in err printing "success", when we want to signal an error. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -627,5 +627,10 @@ getnvmprogname(void)
|
|||||||
static void
|
static void
|
||||||
set_err(int x)
|
set_err(int x)
|
||||||
{
|
{
|
||||||
errno = errno ? errno : x;
|
if (errno)
|
||||||
|
return;
|
||||||
|
if (x)
|
||||||
|
errno = x; /* TODO: check x against system errno values */
|
||||||
|
else
|
||||||
|
errno = ECANCELED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user