mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 14:12:44 +02:00
util/nvmutil: further improved errno handling
This commit is contained in:
@@ -109,20 +109,19 @@ main(int argc, char *argv[])
|
|||||||
cmd = &cmd_copy;
|
cmd = &cmd_copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errno != 0)
|
if ((strMac == NULL) && (cmd == NULL))
|
||||||
goto nvmutil_exit;
|
errno = EINVAL;
|
||||||
|
else if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
|
||||||
if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
|
|
||||||
goto nvmutil_exit;
|
goto nvmutil_exit;
|
||||||
else if (errno == ENOTDIR)
|
else if (errno == ENOTDIR)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
||||||
if (strMac != NULL)
|
if (errno != 0)
|
||||||
|
goto nvmutil_exit;
|
||||||
|
else if (strMac != NULL)
|
||||||
setmac(strMac);
|
setmac(strMac);
|
||||||
else if (cmd != NULL)
|
else if (cmd != NULL)
|
||||||
(*cmd)();
|
(*cmd)();
|
||||||
else
|
|
||||||
errno = EINVAL;
|
|
||||||
|
|
||||||
if (gbeFileModified)
|
if (gbeFileModified)
|
||||||
writeGbeFile(&fd, FILENAME);
|
writeGbeFile(&fd, FILENAME);
|
||||||
|
|||||||
Reference in New Issue
Block a user