diff options
author | Guillem Jover <guillem@debian.org> | 2014-09-10 15:31:41 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 00:48:12 +0200 |
commit | 398875d07d87fb65a4965ffbfe8b860f526a4ad8 (patch) | |
tree | 05547c4178868b79757fdc38e1633166df6949a8 | |
parent | 5c4fdbe903f5006eee3337a1b2c08c1cfe114191 (diff) | |
download | dpkg-398875d07d87fb65a4965ffbfe8b860f526a4ad8.tar.gz |
libdpkg, dpkg: Switch subproc_wait() calls to subproc_wait_check()
Add a new PROCNOCHECK flag to disable the checks and to make both calls
equivalent.
-rw-r--r-- | lib/dpkg/file.c | 2 | ||||
-rw-r--r-- | lib/dpkg/subproc.c | 9 | ||||
-rw-r--r-- | lib/dpkg/subproc.h | 1 | ||||
-rw-r--r-- | src/configure.c | 4 | ||||
-rw-r--r-- | src/unpack.c | 2 |
5 files changed, 12 insertions, 6 deletions
diff --git a/lib/dpkg/file.c b/lib/dpkg/file.c index b35be0121..cff224985 100644 --- a/lib/dpkg/file.c +++ b/lib/dpkg/file.c @@ -173,5 +173,5 @@ file_show(const char *filename) command_add_arg(&cmd, filename); command_exec(&cmd); } - subproc_wait(pid, _("showing file on pager")); + subproc_wait_check(pid, _("showing file on pager"), PROCNOCHECK); } diff --git a/lib/dpkg/subproc.c b/lib/dpkg/subproc.c index f07a378c5..cad968105 100644 --- a/lib/dpkg/subproc.c +++ b/lib/dpkg/subproc.c @@ -157,9 +157,14 @@ subproc_wait(pid_t pid, const char *desc) int subproc_wait_check(pid_t pid, const char *desc, int flags) { - int status; + int status, rc; status = subproc_wait(pid, desc); - return subproc_check(status, desc, flags); + if (flags & PROCNOCHECK) + rc = status; + else + rc = subproc_check(status, desc, flags); + + return rc; } diff --git a/lib/dpkg/subproc.h b/lib/dpkg/subproc.h index e381d3f3d..f4dd7d56f 100644 --- a/lib/dpkg/subproc.h +++ b/lib/dpkg/subproc.h @@ -39,6 +39,7 @@ void subproc_signals_cleanup(int argc, void **argv); #define PROCPIPE 1 #define PROCWARN 2 #define PROCNOERR 4 +#define PROCNOCHECK 8 pid_t subproc_fork(void); int subproc_wait(pid_t pid, const char *desc); diff --git a/src/configure.c b/src/configure.c index e4dfa8a84..ea202bb85 100644 --- a/src/configure.c +++ b/src/configure.c @@ -212,7 +212,7 @@ show_diff(const char *old, const char *new) } /* Parent process. */ - subproc_wait(pid, _("conffile difference visualizer")); + subproc_wait_check(pid, _("conffile difference visualizer"), PROCNOCHECK); } /** @@ -242,7 +242,7 @@ spawn_shell(const char *confold, const char *confnew) } /* Parent process. */ - subproc_wait(pid, _("conffile shell")); + subproc_wait_check(pid, _("conffile shell"), PROCNOCHECK); } /** diff --git a/src/unpack.c b/src/unpack.c index 481a89db3..65e321751 100644 --- a/src/unpack.c +++ b/src/unpack.c @@ -145,7 +145,7 @@ deb_verify(const char *filename) } else { int status; - status = subproc_wait(pid, "debsig-verify"); + status = subproc_wait_check(pid, "debsig-verify", PROCNOCHECK); if (!(WIFEXITED(status) && WEXITSTATUS(status) == 0)) { if (!fc_badverify) ohshit(_("verification on package %s failed!"), filename); |