mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 23:08:49 +02:00
util/nvmutil: improved errno handling in main
This commit is contained in:
@@ -113,15 +113,15 @@ main(int argc, char *argv[])
|
|||||||
else if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
|
else if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
|
||||||
goto nvmutil_exit;
|
goto nvmutil_exit;
|
||||||
|
|
||||||
if (errno != 0)
|
if (errno == 0) {
|
||||||
goto nvmutil_exit;
|
if (strMac != NULL)
|
||||||
else if (strMac != NULL)
|
setmac(strMac);
|
||||||
setmac(strMac);
|
else if (cmd != NULL)
|
||||||
else if (cmd != NULL)
|
(*cmd)();
|
||||||
(*cmd)();
|
|
||||||
|
|
||||||
if (gbeFileModified)
|
if (gbeFileModified)
|
||||||
writeGbeFile(&fd, FILENAME);
|
writeGbeFile(&fd, FILENAME);
|
||||||
|
}
|
||||||
|
|
||||||
nvmutil_exit:
|
nvmutil_exit:
|
||||||
if (!((errno == ECANCELED) && (flags == O_RDONLY)))
|
if (!((errno == ECANCELED) && (flags == O_RDONLY)))
|
||||||
|
|||||||
Reference in New Issue
Block a user