12345678910111213141516171819202122232425262728 |
- // SPDX-License-Identifier: GPL-2.0 or GPL-3.0
- // Copyright © 2018-2019 Ariadne Devos
- /* sHT -- bug reporting / crashing */
- #include <sHT/bugs.h>
- #include <stdio.h>
- #include <stdlib.h>
- __attribute__((nonnull (1)))
- _Noreturn
- static void
- sHT_individual_bug(const char *msg)
- {
- /* TODO: we should be phoning the control thread, but as there is
- no such thing yet ...*/
- (void) dprintf(2, "sHT error: %s\n", msg);
- _Exit(1);
- }
- void
- sHT_bug(const struct sHT_bug_option *options, int code)
- {
- while ((options->code != 0) && (options->code != code))
- options++;
- sHT_individual_bug(options->msg);
- }
|