mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-22 14:36:31 +02:00
libreboot-utils: unified error handling
i now use a singleton hook function per program: nvmutil, mkhtemp and lottery call this at the startup of your program: (void) errhook(exit_cleanup); then provide that function. make it static, so that each program has its own version. if you're writing a program that handles lots of files for example, and you want to do certain cleanup on exit (including error exit), this can be quite useful. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -63,6 +63,6 @@ check_nvm_bound(size_t c, size_t p)
|
||||
check_bin(p, "part number");
|
||||
|
||||
if (c >= NVM_WORDS)
|
||||
b0rk(ECANCELED, "check_nvm_bound: out of bounds %lu",
|
||||
err_exit(ECANCELED, "check_nvm_bound: out of bounds %lu",
|
||||
(size_t)c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user