The following commit has been merged in the master branch:
commit 2a92bb81186b6098ec2a6b77242690d11402faad
Author: Guillem Jover <[email protected]>
Date: Sat Oct 23 05:16:46 2010 +0200
libdpkg: Rename error_unwind() to pop_error_context()
diff --git a/lib/dpkg/dpkg.h b/lib/dpkg/dpkg.h
index 7e62fc6..867a142 100644
--- a/lib/dpkg/dpkg.h
+++ b/lib/dpkg/dpkg.h
@@ -112,7 +112,7 @@ DPKG_BEGIN_DECLS
} while (0)
#define standard_shutdown() do { \
- error_unwind(ehflag_normaltidy);\
+ pop_error_context(ehflag_normaltidy); \
} while (0)
/*** log.c ***/
diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index 8f2a038..0b6255a 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -233,7 +233,12 @@ run_cleanups(struct error_context *econ, int flagsetin)
preventrecurse--;
}
-void error_unwind(int flagset) {
+/**
+ * Unwind the current error context by running its registered cleanups.
+ */
+void
+pop_error_context(int flagset)
+{
struct error_context *tecp;
tecp= econtext;
@@ -247,10 +252,10 @@ void error_unwind(int flagset) {
}
void push_checkpoint(int mask, int value) {
- /* This will arrange that when error_unwind() is called,
+ /* 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 error_unwind
+ * where original_flagset is the argument to pop_error_context()
* (as modified by any checkpoint which was pushed later).
*/
struct cleanup_entry *cep;
@@ -337,7 +342,7 @@ void ohshit(const char *fmt, ...) {
void
catch_fatal_error(void)
{
- error_unwind(ehflag_bombout);
+ pop_error_context(ehflag_bombout);
exit(2);
}
diff --git a/lib/dpkg/ehandle.h b/lib/dpkg/ehandle.h
index f498df2..7fd1689 100644
--- a/lib/dpkg/ehandle.h
+++ b/lib/dpkg/ehandle.h
@@ -53,7 +53,7 @@ void push_error_context_jump(jmp_buf *jbufp, error_printer
*printerror,
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 pop_error_context(int flagset);
void push_cleanup(void (*f1)(int argc, void **argv), int flagmask1,
void (*f2)(int argc, void **argv), int flagmask2,
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 06b3a31..ca94428 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -12,12 +12,12 @@ LIBDPKG_PRIVATE {
push_error_context_jump;
push_error_context_func;
push_error_context;
+ pop_error_context;
print_fatal_error;
catch_fatal_error;
push_checkpoint;
push_cleanup;
pop_cleanup;
- error_unwind;
onerr_abort; # XXX variable, do not export
ohshitv;
ohshite;
diff --git a/lib/dpkg/test.h b/lib/dpkg/test.h
index a1d0fa7..664e4ae 100644
--- a/lib/dpkg/test.h
+++ b/lib/dpkg/test.h
@@ -47,8 +47,7 @@ main(int argc, char **argv)
test();
- /* Shutdown. */
- error_unwind(ehflag_normaltidy);
+ pop_error_context(ehflag_normaltidy);
return 0;
}
diff --git a/src/archives.c b/src/archives.c
index ef51896..4691908 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1247,7 +1247,7 @@ void archivefiles(const char *const *argv) {
while ((thisarg = *argp++) != NULL) {
if (setjmp(ejbuf)) {
- error_unwind(ehflag_bombout);
+ pop_error_context(ehflag_bombout);
if (abort_processing)
break;
continue;
@@ -1259,7 +1259,7 @@ void archivefiles(const char *const *argv) {
m_output(stderr, _("<standard error>"));
onerr_abort--;
- error_unwind(ehflag_normaltidy);
+ pop_error_context(ehflag_normaltidy);
}
switch (cipaction->arg) {
diff --git a/src/main.c b/src/main.c
index 2972f14..6694497 100644
--- a/src/main.c
+++ b/src/main.c
@@ -655,7 +655,7 @@ void commandfd(const char *const *argv) {
actionfunction= (void (*)(const char* const*))cipaction->farg;
actionfunction(newargs);
- error_unwind(ehflag_normaltidy);
+ pop_error_context(ehflag_normaltidy);
}
}
diff --git a/src/packages.c b/src/packages.c
index cfdde66..10c8ed1 100644
--- a/src/packages.c
+++ b/src/packages.c
@@ -215,7 +215,8 @@ void process_queue(void) {
if (setjmp(ejbuf)) {
/* give up on it from the point of view of other packages, ie reset
istobe */
pkg->clientdata->istobe= itb_normal;
- error_unwind(ehflag_bombout);
+
+ pop_error_context(ehflag_bombout);
if (abort_processing)
return;
continue;
@@ -249,7 +250,7 @@ void process_queue(void) {
m_output(stdout, _("<standard output>"));
m_output(stderr, _("<standard error>"));
- error_unwind(ehflag_normaltidy);
+ pop_error_context(ehflag_normaltidy);
}
assert(!queue.length);
}
diff --git a/src/trigproc.c b/src/trigproc.c
index b1151fd..5d3c9be 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -114,7 +114,7 @@ trigproc_run_deferred(void)
continue;
if (setjmp(ejbuf)) {
- error_unwind(ehflag_bombout);
+ pop_error_context(ehflag_bombout);
continue;
}
push_error_handler(&ejbuf, print_error_perpackage, pkg->name);
@@ -122,7 +122,7 @@ trigproc_run_deferred(void)
pkg->clientdata->trigprocdeferred = NULL;
trigproc(pkg);
- error_unwind(ehflag_normaltidy);
+ pop_error_context(ehflag_normaltidy);
}
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]