diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-28 06:53:37 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-28 06:53:37 +0000 |
| commit | 0f1a22174fc7c6a0767617974640d521074174d5 (patch) | |
| tree | 5d13587d08a95332518b3191b7440424f0f190c6 /util/libreboot-utils/lib/checksum.c | |
| parent | 55f0e6ac8e540cea24af64070bfc49a032729511 (diff) | |
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>
Diffstat (limited to 'util/libreboot-utils/lib/checksum.c')
| -rw-r--r-- | util/libreboot-utils/lib/checksum.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/libreboot-utils/lib/checksum.c b/util/libreboot-utils/lib/checksum.c index 9a041989..97b0efca 100644 --- a/util/libreboot-utils/lib/checksum.c +++ b/util/libreboot-utils/lib/checksum.c @@ -59,10 +59,10 @@ read_checksums(void) if (_num_invalid >= _max_invalid) { if (_max_invalid == 1) - b0rk(ECANCELED, "%s: part %lu has a bad checksum", + err_exit(ECANCELED, "%s: part %lu has a bad checksum", f->fname, (size_t)f->part); - b0rk(ECANCELED, "%s: No valid checksum found in file", + err_exit(ECANCELED, "%s: No valid checksum found in file", f->fname); } } |
