dpkg 1.21.11
Data Structures | Macros | Functions | Variables
ehandle.c File Reference

(889848ed5)

#include <config.h>
#include <compat.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <dpkg/macros.h>
#include <dpkg/i18n.h>
#include <dpkg/progname.h>
#include <dpkg/color.h>
#include <dpkg/ehandle.h>
Include dependency graph for ehandle.c:

Data Structures

struct  cleanup_entry
 
struct  error_context
 

Macros

#define NCALLS   2
 

Functions

void catch_fatal_error (void)
 Default fatal error handler. More...
 
void print_fatal_error (const char *emsg, const void *data)
 
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)
 
void push_error_context (void)
 
void push_checkpoint (int mask, int value)
 Push an error cleanup checkpoint. More...
 
void push_cleanup (void(*call)(int argc, void **argv), int mask, unsigned int nargs,...)
 
void push_cleanup_fallback (void(*call1)(int argc, void **argv), int mask1, void(*call2)(int argc, void **argv), int mask2, unsigned int nargs,...)
 
void pop_cleanup (int flagset)
 
void pop_error_context (int flagset)
 Unwind the current error context by running its registered cleanups. More...
 
void ohshit (const char *fmt,...)
 
void ohshitv (const char *fmt, va_list args)
 
void ohshite (const char *fmt,...)
 
void do_internerr (const char *file, int line, const char *func, const char *fmt,...)
 

Variables

volatile int onerr_abort = 0
 

Macro Definition Documentation

◆ NCALLS

#define NCALLS   2

Variable Documentation

◆ args

void* args[20]

◆ ce

struct cleanup_entry ce

◆ errmsg

char errmsg[4096]

Emergency error message buffer.

The size is estimated using the following heuristic:

  • 6x255 For inserted strings (%.255s &c in fmt; and s with limited length arg).
  • 1x255 For constant text.
  • 1x255 For strerror().
  • And the total doubled just in case.

Referenced by ohshite().