diff options
author | Guillem Jover <guillem@debian.org> | 2012-04-23 09:05:33 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 00:48:13 +0200 |
commit | cece29526d506b89b54cc80a6c400f9f58f36286 (patch) | |
tree | 126de02ec5b4ffa423286c802cc0f897cf7dcd18 | |
parent | 054129e47776db138d367b16a3f1552426d1051d (diff) | |
download | dpkg-cece29526d506b89b54cc80a6c400f9f58f36286.tar.gz |
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().
-rw-r--r-- | dselect/method.cc | 2 | ||||
-rw-r--r-- | lib/dpkg/libdpkg.map | 1 | ||||
-rw-r--r-- | lib/dpkg/subproc.c | 6 | ||||
-rw-r--r-- | lib/dpkg/subproc.h | 1 | ||||
-rw-r--r-- | src/script.c | 4 |
5 files changed, 11 insertions, 3 deletions
diff --git a/dselect/method.cc b/dselect/method.cc index c291c206c..8da2e82dc 100644 --- a/dselect/method.cc +++ b/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); diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map index 51956c66d..97b93c2ac 100644 --- a/lib/dpkg/libdpkg.map +++ b/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; diff --git a/lib/dpkg/subproc.c b/lib/dpkg/subproc.c index 27af9de85..8e7a1d7f8 100644 --- a/lib/dpkg/subproc.c +++ b/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) { diff --git a/lib/dpkg/subproc.h b/lib/dpkg/subproc.h index 203446cb2..8cbab442e 100644 --- a/lib/dpkg/subproc.h +++ b/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 diff --git a/src/script.c b/src/script.c index c4b11df2d..f678b70d6 100644 --- a/src/script.c +++ b/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); |