Преглед изворни кода

libdpkg: Add new push_error_context() function

This new function pushes a default error context.
Guillem Jover пре 15 година
родитељ
комит
841f42173e
3 измењених фајлова са 8 додато и 0 уклоњено
  1. 6 0
      lib/dpkg/ehandle.c
  2. 1 0
      lib/dpkg/ehandle.h
  3. 1 0
      lib/dpkg/libdpkg.Versions

+ 6 - 0
lib/dpkg/ehandle.c

@@ -174,6 +174,12 @@ push_error_context_jump(jmp_buf *jump, error_printer *printerror,
   onerr_abort = 0;
 }
 
+void
+push_error_context(void)
+{
+  push_error_context_func(catch_fatal_error, print_fatal_error, NULL);
+}
+
 static void
 print_cleanup_error(const char *emsg, const char *contextstring)
 {

+ 1 - 0
lib/dpkg/ehandle.h

@@ -52,6 +52,7 @@ void push_error_context_jump(jmp_buf *jbufp, error_printer *printerror,
                              const char *contextstring);
 void push_error_context_func(error_handler *func, error_printer *printerror,
                              const char *contextstring);
+void push_error_context(void);
 void error_unwind(int flagset);
 
 void push_cleanup(void (*f1)(int argc, void **argv), int flagmask1,

+ 1 - 0
lib/dpkg/libdpkg.Versions

@@ -11,6 +11,7 @@ LIBDPKG_PRIVATE {
 	# Error handling
 	push_error_context_jump;
 	push_error_context_func;
+	push_error_context;
 	print_fatal_error;
 	catch_fatal_error;
 	push_checkpoint;