[Reproducible-commits] [dpkg] 62/90: libdpkg: Set used signals in test suite to their default action

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 14dff6e0c34443bcc0be402627549d891df4813b
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Aug 1 11:05:03 2015 +0200

    libdpkg: Set used signals in test suite to their default action
    
    This fixes build failures when SIGINT, SIGTERM or SIGPIPE are set to
    ignore the signals.
---
 debian/changelog       | 3 +++
 lib/dpkg/t/t-subproc.c | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a4da0c3..1432a06 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -59,6 +59,9 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     - Future-proof tar invocations in Dpkg::Source::Archive for options that
       might become positional in the future, and by always placing function
       options first.
+  * Test suite:
+    - Set SIGINT, SIGTERM and SIGPIPE to their default actions to get
+      deterministic behavior.
   * Packaging:
     - Make the libdpkg-dev package Multi-Arch:same.
     - Mark libio-string-perl as <!nocheck>.
diff --git a/lib/dpkg/t/t-subproc.c b/lib/dpkg/t/t-subproc.c
index 4b928e2..42651c4 100644
--- a/lib/dpkg/t/t-subproc.c
+++ b/lib/dpkg/t/t-subproc.c
@@ -34,9 +34,16 @@
 static void
 test_subproc_fork(void)
 {
+	struct sigaction sa;
 	pid_t pid;
 	int ret;
 
+	memset(&sa, 0, sizeof(sa));
+	sa.sa_handler = SIG_DFL;
+	sigaction(SIGINT, &sa, NULL);
+	sigaction(SIGTERM, &sa, NULL);
+	sigaction(SIGPIPE, &sa, NULL);
+
 	/* Test exit(). */
 	pid = subproc_fork();
 	if (pid == 0)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list