From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RpcWr-0002I6-8G for ptxdist@pengutronix.de; Tue, 24 Jan 2012 10:19:01 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1RpcWr-000815-7F for ptxdist@pengutronix.de; Tue, 24 Jan 2012 10:19:01 +0100 Date: Tue, 24 Jan 2012 10:19:01 +0100 From: Michael Olbrich Message-ID: <20120124091901.GL12400@pengutronix.de> References: <1327265267-48214-1-git-send-email-bernhard@bwalle.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1327265267-48214-1-git-send-email-bernhard@bwalle.de> Subject: Re: [ptxdist] [PATCH] Support reading number of CPUs on Mac OS X Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Sun, Jan 22, 2012 at 09:47:47PM +0100, Bernhard Walle wrote: > Tested on 10.7 (Lion). > > Signed-off-by: Bernhard Walle > --- > 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