The following commit has been merged in the master branch:
commit 5dd05803b51dc2a0aae9b8ad52cd58fff5e52c88
Author: Guillem Jover <[email protected]>
Date: Mon Oct 11 20:27:53 2010 +0200
libdpkg: Refactor error_context creation into a new function
diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index 8b8cafa..79b19eb 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -99,9 +99,8 @@ run_error_handler(void)
}
}
-void
-push_error_handler(jmp_buf *jump, error_printer *printerror,
- const char *contextstring)
+static struct error_context *
+error_context_new(void)
{
struct error_context *necp;
@@ -116,12 +115,23 @@ push_error_handler(jmp_buf *jump, error_printer
*printerror,
fprintf(stderr, "%s: %s\n", thisname, errmsgbuf); exit(2);
}
necp->next= econtext;
- necp->jump = jump;
necp->cleanups= NULL;
- necp->printerror= printerror;
- necp->contextstring= contextstring;
econtext= necp;
- onerr_abort= 0;
+
+ return necp;
+}
+
+void
+push_error_handler(jmp_buf *jump, error_printer *printerror,
+ const char *contextstring)
+{
+ struct error_context *ec;
+
+ ec = error_context_new();
+ ec->printerror = printerror;
+ ec->contextstring = contextstring;
+ ec->jump = jump;
+ onerr_abort = 0;
}
static void
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]