dpkg 1.21.11
|
Macros | |
#define | internerr(...) do_internerr(__FILE__, __LINE__, __func__, __VA_ARGS__) |
Typedefs | |
typedef void | error_handler_func(void) |
typedef void | error_printer_func(const char *emsg, const void *data) |
Enumerations | |
enum | { ehflag_normaltidy = DPKG_BIT(0) , ehflag_bombout = DPKG_BIT(1) , ehflag_recursiveerror = DPKG_BIT(2) } |
Functions | |
void | print_fatal_error (const char *emsg, const void *data) |
void | catch_fatal_error (void) |
Default fatal error handler. More... | |
void | push_error_context_jump (jmp_buf *jumper, error_printer_func *printer, const void *printer_data) |
void | push_error_context_func (error_handler_func *handler, error_printer_func *printer, const void *printer_data) |
void | push_error_context (void) |
void | pop_error_context (int flagset) |
Unwind the current error context by running its registered cleanups. More... | |
void | push_cleanup_fallback (void(*f1)(int argc, void **argv), int flagmask1, void(*f2)(int argc, void **argv), int flagmask2, unsigned int nargs,...) |
void | push_cleanup (void(*call)(int argc, void **argv), int flagmask, unsigned int nargs,...) |
void | push_checkpoint (int mask, int value) |
Push an error cleanup checkpoint. More... | |
void | pop_cleanup (int flagset) |
void | ohshitv (const char *fmt, va_list args) DPKG_ATTR_NORET DPKG_ATTR_VPRINTF(1) |
void | ohshit (const char *fmt,...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1) |
void | ohshite (const char *fmt,...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1) |
void | do_internerr (const char *file, int line, const char *func, const char *fmt,...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(4) |
Variables | |
volatile int | onerr_abort |
#define internerr | ( | ... | ) | do_internerr(__FILE__, __LINE__, __func__, __VA_ARGS__) |
typedef void error_handler_func(void) |
typedef void error_printer_func(const char *emsg, const void *data) |
void catch_fatal_error | ( | void | ) |
Default fatal error handler.
This handler performs all error unwinding for the current context, and terminates the program with an error exit code.
References ehflag_bombout, and pop_error_context().
Referenced by push_error_context(), and subproc_fork().
void do_internerr | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
const char * | fmt, | ||
... | |||
) |
References args, color_get(), COLOR_PROG, dpkg_get_progname(), and error_context::func.
void ohshit | ( | const char * | fmt, |
... | |||
) |
References args.
Referenced by addtopartlist(), badusage(), deferred_configure(), do_showinfo(), dpkg_ar_member_get_size(), dpkg_ar_member_put_header(), dpkg_error_print(), dpkg_selabel_load(), fgets_checked(), fgets_must(), find_command(), md5hash(), modstatdb_lock(), parse_error(), parse_problem(), parsedb_load(), pkg_hash_find_singleton(), predeppackage(), read_fail(), reassemble(), statdb_parse_gid(), statdb_parse_mode(), statdb_parse_uid(), str_gen_crop(), str_width(), tarobject(), updateavailable(), validate_archname(), validate_pkgname(), validate_trigname(), and varbuf_grow().
void ohshite | ( | const char * | fmt, |
... | |||
) |
Referenced by atomic_file_close(), atomic_file_open(), atomic_file_remove(), atomic_file_sync(), command_exec(), commandfd(), cu_installnew(), dir_sync_contents(), dir_sync_path(), do_info(), dpkg_ar_close(), dpkg_ar_create(), dpkg_ar_fdopen(), dpkg_ar_member_put_file(), dpkg_ar_member_put_header(), dpkg_ar_open(), dpkg_ar_put_magic(), dpkg_selabel_load(), dpkg_selabel_set_context(), fgets_checked(), file_copy_perms(), file_show(), m_dup(), m_dup2(), m_output(), m_pipe(), m_vasprintf(), maintscript_new(), mustgetpartinfo(), parsedb_close(), parsedb_load(), parsedb_open(), path_remove_tree(), pkg_infodb_has_file(), push_checkpoint(), read_fail(), read_info(), reassemble(), setcloexec(), subproc_fork(), tarfileread(), tarobject(), updateavailable(), varbuf_vprintf(), writedb_records(), and writerecord().
void ohshitv | ( | const char * | fmt, |
va_list | args | ||
) |
void pop_cleanup | ( | int | flagset | ) |
Referenced by atomic_file_close(), md5hash(), modstatdb_unlock(), parsedb_close(), and subproc_signals_restore().
void pop_error_context | ( | int | flagset | ) |
Unwind the current error context by running its registered cleanups.
Referenced by catch_fatal_error(), and dpkg_program_done().
void print_fatal_error | ( | const char * | emsg, |
const void * | data | ||
) |
References color_get(), COLOR_PROG, and dpkg_get_progname().
Referenced by push_error_context().
void push_checkpoint | ( | int | mask, |
int | value | ||
) |
Push an error cleanup checkpoint.
This will arrange that when pop_error_context() is called, all previous cleanups will be executed with flagset = (original_flagset & mask) | value where original_flagset is the argument to pop_error_context() (as modified by any checkpoint which was pushed later).
References _, cleanup_entry::argc, cleanup_entry::argv, cleanup_entry::call, cleanup_entry::calls, cleanup_entry::cpmask, cleanup_entry::cpvalue, cleanup_entry::mask, NCALLS, cleanup_entry::next, ohshite(), and onerr_abort.
void push_cleanup | ( | void(*)(int argc, void **argv) | call, |
int | flagmask, | ||
unsigned int | nargs, | ||
... | |||
) |
References args.
Referenced by atomic_file_open(), md5hash(), and parsedb_open().
void push_cleanup_fallback | ( | void(*)(int argc, void **argv) | f1, |
int | flagmask1, | ||
void(*)(int argc, void **argv) | f2, | ||
int | flagmask2, | ||
unsigned int | nargs, | ||
... | |||
) |
References args.
void push_error_context | ( | void | ) |
References catch_fatal_error(), print_fatal_error(), and push_error_context_func().
Referenced by commandfd().
void push_error_context_func | ( | error_handler_func * | handler, |
error_printer_func * | printer, | ||
const void * | printer_data | ||
) |
void push_error_context_jump | ( | jmp_buf * | jumper, |
error_printer_func * | printer, | ||
const void * | printer_data | ||
) |
|
extern |
Referenced by m_dup(), m_dup2(), m_pipe(), m_vasprintf(), modstatdb_note(), push_checkpoint(), subproc_fork(), and subproc_signals_ignore().