public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] MAKEALL: fix kill_children for BSD hosts
Date: Wed, 23 Jan 2013 12:28:43 +0100	[thread overview]
Message-ID: <50FFC96B.1020102@gmail.com> (raw)
In-Reply-To: <1358898669-21682-1-git-send-email-andreas.devel@googlemail.com>

On 23.01.2013 00:51, Andreas Bie?mann wrote:
> ps on BSD hosts (like OS X) do not provide the --no-headers switch nor
> understand the AIX format descriptions. Make the call for ps portable and filter
> the relevant line from output (including the header) with sed.
> Also switch from pgrep to ps to get the list of children and use the same
> mechanism as for pgid.
> 
> This patch makes the MAKEALL script cleanly stoppable on bare OS X when using
> the parallel builds of targets.
> 
> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> ---
>  MAKEALL | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MAKEALL b/MAKEALL
> index 5b06c54..d926846 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -784,8 +784,8 @@ build_targets() {
>  #-----------------------------------------------------------------------
>  
>  kill_children() {
> -	local pgid=`ps -p $$ --no-headers -o "%r" | tr -d ' '`
> -	local children=`pgrep -g $pgid | grep -v $$ | grep -v $pgid`
> +	local pgid=`ps -p $$ -o pgid | sed -e "/PGID/d"`
> +	local children=`ps -g $pgid -o pid | sed -e "/PID\|$$\|$pgid/d"`

Oumpf, just realized that the 'ps -g' is _not_ portable though. The
linux variant selects by session OR group name while the BSD variant
uses the process group.
I'm looking for a better solution which is portable.

Best regards

Andreas Bie?mann

  reply	other threads:[~2013-01-23 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 23:51 [U-Boot] [PATCH] MAKEALL: fix kill_children for BSD hosts Andreas Bießmann
2013-01-23 11:28 ` Andreas Bießmann [this message]
2013-02-08  8:35 ` [U-Boot] [PATCH v2] " Andreas Bießmann
2013-02-08 20:52   ` Joe Hershberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50FFC96B.1020102@gmail.com \
    --to=andreas.devel@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox