mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +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
|
||||
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