diff options
author | Guillem Jover <guillem@debian.org> | 2014-10-02 06:03:00 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 00:48:13 +0200 |
commit | 6821616fc62734abc60ab98ae7bc6b37db772457 (patch) | |
tree | dab1a6f23d52e0734f12264410d12811c20f0ea0 /lib | |
parent | b097b5cf5dd032ccc6bc946d837da5d2c5baad6f (diff) | |
download | dpkg-6821616fc62734abc60ab98ae7bc6b37db772457.tar.gz |
libdpkg: Add new SUBPROC_RETSIGNO to return the signal number
This will allow to replace some ad-hoc code in debsig-verify.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpkg/subproc.c | 2 | ||||
-rw-r--r-- | lib/dpkg/subproc.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/dpkg/subproc.c b/lib/dpkg/subproc.c index 7f1303b6a..6367a0d81 100644 --- a/lib/dpkg/subproc.c +++ b/lib/dpkg/subproc.c @@ -143,6 +143,8 @@ subproc_check(int status, const char *desc, enum subproc_flags flags) return 0; if ((flags & SUBPROC_NOPIPE) && n == SIGPIPE) return 0; + if (flags & SUBPROC_RETSIGNO) + return n; if (n == SIGINT) out(_("subprocess %s was interrupted"), desc); diff --git a/lib/dpkg/subproc.h b/lib/dpkg/subproc.h index 38b068255..8e5d64336 100644 --- a/lib/dpkg/subproc.h +++ b/lib/dpkg/subproc.h @@ -44,6 +44,8 @@ enum subproc_flags { SUBPROC_NOCHECK = DPKG_BIT(2), /** Do not emit errors, just return the exit status. */ SUBPROC_RETERROR = DPKG_BIT(3), + /** Do not emit errors, just return the signal number. */ + SUBPROC_RETSIGNO = DPKG_BIT(3), }; void subproc_signals_ignore(const char *name); |