The following commit has been merged in the master branch:
commit 29f4ab41c95abf9639b81918d9b7aa1ca8edbe81
Author: Guillem Jover <guil...@debian.org>
Date:   Sat Oct 16 19:16:50 2010 +0200

    libdpkg: Create a new error context in subproc_fork
    
    Instead of changing the current error display handler and pushing a
    cleanup handler that exits immediately to avoid calling previously
    set cleanup handlers, just push a new error context which will work
    as a cleanup barrier. This also is a more natural way of using the
    current interface.

diff --git a/lib/dpkg/subproc.c b/lib/dpkg/subproc.c
index 26bd074..7a48979 100644
--- a/lib/dpkg/subproc.c
+++ b/lib/dpkg/subproc.c
@@ -77,14 +77,6 @@ print_subproc_error(const char *emsg, const char 
*contextstring)
        fprintf(stderr, _("%s (subprocess): %s\n"), thisname, emsg);
 }
 
-static void DPKG_ATTR_NORET
-subproc_fork_cleanup(int argc, void **argv)
-{
-       /* Don't do the other cleanups, because they'll be done by/in the
-        * parent process. */
-       exit(2);
-}
-
 pid_t
 subproc_fork(void)
 {
@@ -98,8 +90,9 @@ subproc_fork(void)
        if (r > 0)
                return r;
 
-       push_cleanup(subproc_fork_cleanup, ~0, NULL, 0, 0);
-       set_error_display(print_subproc_error, NULL);
+       /* Push a new error context, so that we don't do the other cleanups,
+        * because they'll be done by/in the parent process. */
+       push_error_context_func(catch_fatal_error, print_subproc_error, NULL);
 
        return r;
 }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to