dpkg 1.22.7-3-g89f48
|
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. | |
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. | |
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. | |
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_ERROR, color_get(), COLOR_PROG, dpkg_get_progname(), error_context::errmsg, and error_context::func.
void ohshit | ( | const char * | fmt, |
... | |||
) |
References args.
Referenced by addtopartlist(), archivefiles(), badusage(), check_breaks(), check_conflict(), command_in_path(), commandfd(), deferred_configure(), deferred_remove(), do_auto(), do_build(), do_join(), do_queue(), do_showinfo(), dpkg_ar_member_get_size(), dpkg_ar_member_put_file(), dpkg_ar_member_put_header(), dpkg_error_print(), dpkg_selabel_load(), ensure_diversions(), ensure_statoverrides(), extracthalf(), fgets_checked(), fgets_must(), file_is_locked(), file_lock(), maintscript_fallback(), md5hash(), modstatdb_lock(), modstatdb_open(), parse_error(), parse_lax_problem(), parse_problem(), parsedb_load(), parsedb_parse(), pkg_hash_find_singleton(), pkg_source_version(), predeppackage(), process_archive(), process_queue(), read_fail(), read_info(), reassemble(), setselections(), statdb_parse_gid(), statdb_parse_mode(), statdb_parse_uid(), str_gen_crop(), str_width(), tarobject(), treewalk_open(), trig_file_interests_ensure(), trig_parse_ci(), trigdef_parse(), trigproc(), updateavailable(), validate_archname(), validate_pkgname(), validate_trigname(), and varbuf_grow().
void ohshite | ( | const char * | fmt, |
... | |||
) |
References args, error_context::errmsg, and errmsg.
Referenced by archivefiles(), atomic_file_close(), atomic_file_commit(), atomic_file_open(), atomic_file_remove(), atomic_file_sync(), command_exec(), command_shell(), commandfd(), cu_installnew(), dir_sync_contents(), dir_sync_path(), do_auto(), do_build(), do_info(), do_queue(), dpkg_ar_close(), dpkg_ar_create(), dpkg_ar_fdopen(), dpkg_ar_member_put_file(), dpkg_ar_member_put_header(), dpkg_ar_member_put_mem(), dpkg_ar_open(), dpkg_ar_put_magic(), dpkg_arch_save_list(), dpkg_db_reopen(), dpkg_selabel_load(), dpkg_selabel_set_context(), ensure_statoverrides(), extracthalf(), fgets_checked(), file_copy_perms(), file_lock(), file_show(), file_unlock(), m_dup(), m_dup2(), m_output(), m_pipe(), m_vasprintf(), main(), maintscript_fallback(), maintscript_new(), modstatdb_can_lock(), modstatdb_checkpoint(), modstatdb_is_locked(), modstatdb_open(), mustgetpartinfo(), parsedb_close(), parsedb_load(), parsedb_open(), path_remove_tree(), pkg_infodb_foreach(), pkg_infodb_has_file(), process_archive(), push_checkpoint(), read_fail(), read_info(), reassemble(), removal_bulk(), setcloexec(), setselections(), statusfd_send(), subproc_fork(), tar_deferred_extract(), tarfileread(), tarobject(), trig_file_interests_ensure(), trig_incorporate(), trig_parse_ci(), trigdef_process_done(), trigdef_update_start(), updateavailable(), varbuf_vprintf(), write_stanza(), and writedb_stanzas().
void ohshitv | ( | const char * | fmt, |
va_list | args | ||
) |
void pop_cleanup | ( | int | flagset | ) |
References cleanup_entry::argc, cleanup_entry::argv, cleanup_entry::call, cleanup_entry::calls, error_context::cleanups, cleanup_entry::mask, NCALLS, and cleanup_entry::next.
Referenced by atomic_file_close(), md5hash(), modstatdb_unlock(), parsedb_close(), pkg_infodb_foreach(), process_archive(), subproc_signals_restore(), trig_file_interests_ensure(), trig_parse_ci(), trigdef_process_done(), and trigdef_update_start().
void pop_error_context | ( | int | flagset | ) |
Unwind the current error context by running its registered cleanups.
References ehflag_normaltidy, and error_context::next.
Referenced by archivefiles(), catch_fatal_error(), commandfd(), dpkg_program_done(), process_queue(), and trigproc_run_deferred().
void print_fatal_error | ( | const char * | emsg, |
const void * | data | ||
) |
References _, COLOR_ERROR, 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, error_context::cleanups, cleanup_entry::cpmask, cleanup_entry::cpvalue, cleanup_entry::mask, NCALLS, cleanup_entry::next, ohshite(), and onerr_abort.
Referenced by process_archive().
void push_cleanup | ( | void(*)(int argc, void **argv) | call, |
int | flagmask, | ||
unsigned int | nargs, | ||
... | |||
) |
References args, cleanup_entry::call, and cleanup_entry::mask.
Referenced by atomic_file_open(), deferred_remove(), file_lock(), md5hash(), parsedb_open(), pkg_infodb_foreach(), process_archive(), subproc_signals_ignore(), tarobject(), trig_file_interests_ensure(), and trig_parse_ci().
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(), and dpkg_program_init().
void push_error_context_func | ( | error_handler_func * | handler, |
error_printer_func * | printer, | ||
const void * | printer_data | ||
) |
References error_context::handler, onerr_abort, and error_context::printer.
Referenced by push_error_context(), and subproc_fork().
void push_error_context_jump | ( | jmp_buf * | jumper, |
error_printer_func * | printer, | ||
const void * | printer_data | ||
) |
References onerr_abort, and error_context::printer.
Referenced by archivefiles(), process_queue(), and trigproc_run_deferred().
|
extern |
Referenced by archivefiles(), dpkg_db_reopen(), ensure_diversions(), ensure_packagefiles_available(), ensure_statoverrides(), m_dup(), m_dup2(), m_pipe(), m_vasprintf(), modstatdb_note(), push_checkpoint(), push_error_context_func(), push_error_context_jump(), subproc_fork(), and subproc_signals_ignore().