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 /lib | |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpkg/file.c | 2 | ||||
-rw-r--r-- | lib/dpkg/subproc.c | 9 | ||||
-rw-r--r-- | lib/dpkg/subproc.h | 1 |
3 files changed, 9 insertions, 3 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); |