From eebad679524173ed535fac17bd2b0a117f44ef81 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Thu, 16 Apr 2009 08:59:28 +0000 Subject: Suppress error messages from pgrep and kill, bugs 174354 and 264734. svn path=/trunk/; revision=429 --- libs/core.bash.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libs/core.bash.in') diff --git a/libs/core.bash.in b/libs/core.bash.in index 3c647e6..baad085 100644 --- a/libs/core.bash.in +++ b/libs/core.bash.in @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2005-2006 Gentoo Foundation. +# Copyright (c) 2005-2009 Gentoo Foundation. # $Id$ # This file is part of the 'eselect' tools framework. # @@ -60,9 +60,11 @@ die() { # Evil, but effective. kill ${ESELECT_KILL_TARGET} - childs=$(pgrep -P ${ESELECT_KILL_TARGET}) - for process in ${ESELECT_KILL_TARGET} ${childs} ; do - kill -9 ${process} + # Is this actually needed? Killing the parent should be enough. + local children process + children=$(pgrep -P ${ESELECT_KILL_TARGET} 2>/dev/null) + for process in ${ESELECT_KILL_TARGET} ${children} ; do + kill -9 ${process} &>/dev/null done exit 249 } -- cgit v1.2.3-65-gdbad