gnu: gegl: Fix CVE-2012-4433.
[jackhill/guix/guix.git] / gnu / packages / patches / ngircd-handle-zombies.patch
1 The Guile process taking the role of PID 1 during Guix builds does not reap
2 zombie processes, which makes them continue responding to "kill -0".
3
4 --- a/src/testsuite/stop-server.sh 2015-02-05 11:24:00.535908842 +0100
5 +++ b/src/testsuite/stop-server.sh 2015-02-05 11:25:00.264351349 +0100
6 @@ -1,6 +1,21 @@
7 #!/bin/sh
8 # ngIRCd Test Suite
9
10 +process_is_alive(){
11 + ! process_is_dead "$1" && ! process_is_undead "$1"
12 +}
13 +
14 +process_is_dead(){
15 + ! kill -0 "$1"
16 +}
17 +
18 +process_is_undead(){
19 + case $(ps -p "$1" -o state=) in
20 + (Z*) true ;;
21 + (*) false ;;
22 + esac
23 +}
24 +
25 [ -z "$srcdir" ] && srcdir=`dirname $0`
26
27 # read in functions
28 @@ -24,7 +40,7 @@
29
30 # waiting ...
31 for i in 1 2 3 4 5; do
32 - kill -0 $pid > /dev/null 2>&1; r=$?
33 + process_is_alive $pid > /dev/null 2>&1; r=$?
34 if [ $r -ne 0 ]; then
35 echo " ok".
36 exit 0