The following commit has been merged in the master branch:
commit 3ce8687ba6a738ac9b7195060948512fa7560ada
Author: Guillem Jover <[email protected]>
Date: Wed Oct 6 11:30:14 2010 +0200
libdpkg: Properly restore errno in push_cleanup
The code was saving errno for latter use, but stomping on the saved
value by assigning again errno to it. Invert the assignment so that
we restore errno instead of losing it.
diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index f9e92e1..0734c73 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -200,7 +200,7 @@ void push_cleanup(void (*call1)(int argc, void **argv), int
mask1,
unsigned int nargs, ...) {
struct cleanupentry *cep;
void **argv;
- int e;
+ int e = 0;
va_list args;
onerr_abort++;
@@ -222,7 +222,10 @@ void push_cleanup(void (*call1)(int argc, void **argv),
int mask1,
va_end(args);
cep->next= econtext->cleanups;
econtext->cleanups= cep;
- if (cep == &emergency.ce) { e= errno; ohshite(_("out of memory for new
cleanup entry")); }
+ if (cep == &emergency.ce) {
+ errno = e;
+ ohshite(_("out of memory for new cleanup entry"));
+ }
onerr_abort--;
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]