mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] Support reading number of CPUs on Mac OS X
Date: Tue, 24 Jan 2012 10:19:01 +0100	[thread overview]
Message-ID: <20120124091901.GL12400@pengutronix.de> (raw)
In-Reply-To: <1327265267-48214-1-git-send-email-bernhard@bwalle.de>

On Sun, Jan 22, 2012 at 09:47:47PM +0100, Bernhard Walle wrote:
> Tested on 10.7 (Lion).
> 
> Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
> ---
>  bin/ptxdist |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/bin/ptxdist b/bin/ptxdist
> index 74a52ad..4edbac3 100755
> --- a/bin/ptxdist
> +++ b/bin/ptxdist
> @@ -2093,6 +2093,8 @@ setup_config() {
>  		if [ ${cpus} -eq 0 ]; then
>  			cpus=1
>  		fi
> +	elif [ "$(uname -s)" = Darwin ] ; then
> +		cpus=$(sysctl -n hw.ncpu)

- Is sysctl alwyas in $PATH? On Linux it's in sbin.
- the value should be quoted.
- Does this _always_ and _only_ work on Mac OS X?

Maybe something like this:

	elfi ! cpus="$(sysctl -n hw.ncpu)" 2> /dev/null; then
		cpus=1
	fi

Michael

>  	else
>  		cpus=1
>  	fi
> -- 
> 1.7.7.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2012-01-24  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22 20:47 Bernhard Walle
2012-01-24  9:19 ` Michael Olbrich [this message]
2012-01-24 18:04   ` Bernhard Walle

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=20120124091901.GL12400@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.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