Browse Source

libdpkg: Add new alias subproc_signals_restore() for pop_cleanup()

This hides the fact that to restore the signals we are doing a
pop_cleanup().
Guillem Jover 14 years ago
parent
commit
cece29526d
5 changed files with 11 additions and 3 deletions
  1. 1 1
      dselect/method.cc
  2. 1 0
      lib/dpkg/libdpkg.map
  3. 6 0
      lib/dpkg/subproc.c
  4. 1 0
      lib/dpkg/subproc.h
  5. 2 2
      src/script.c

+ 1 - 1
dselect/method.cc

@@ -152,7 +152,7 @@ falliblesubprocess(struct command *cmd)
 
   i = subproc_reap(pid, cmd->name, PROCWARN);
 
-  pop_cleanup(ehflag_normaltidy);
+  subproc_signals_restore();
 
   if (i == 0) {
     sleep(1);

+ 1 - 0
lib/dpkg/libdpkg.map

@@ -133,6 +133,7 @@ LIBDPKG_PRIVATE {
 	# Subprocess and command handling
 	subproc_signals_ignore;
 	subproc_signals_cleanup;
+	subproc_signals_restore;
 	subproc_fork;
 	subproc_reap;
 

+ 6 - 0
lib/dpkg/subproc.c

@@ -86,6 +86,12 @@ subproc_signals_cleanup(int argc, void **argv)
 		subproc_reset_signal(signo_ignores[i], &sa_save[i]);
 }
 
+void
+subproc_signals_restore(void)
+{
+	pop_cleanup(ehflag_normaltidy);
+}
+
 static void
 print_subproc_error(const char *emsg, const void *data)
 {

+ 1 - 0
lib/dpkg/subproc.h

@@ -35,6 +35,7 @@ DPKG_BEGIN_DECLS
 
 void subproc_signals_ignore(const char *name);
 void subproc_signals_cleanup(int argc, void **argv);
+void subproc_signals_restore(void);
 
 #define PROCPIPE 1
 #define PROCWARN 2

+ 2 - 2
src/script.c

@@ -183,9 +183,9 @@ maintscript_exec(struct pkginfo *pkg, struct pkgbin *pkgbin,
 
 		command_exec(cmd);
 	}
-	subproc_signals_ignore(cmd->name); /* This does a push_cleanup(). */
+	subproc_signals_ignore(cmd->name);
 	rc = subproc_reap(pid, cmd->name, warn);
-	pop_cleanup(ehflag_normaltidy);
+	subproc_signals_restore();
 
 	pop_cleanup(ehflag_normaltidy);