On Sun, Jan 22, 2012 at 09:47:47PM +0100, Bernhard Walle wrote:
> Tested on 10.7 (Lion).
> 
> Signed-off-by: Bernhard Walle <[email protected]>
> ---
>  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
> [email protected]
> 

-- 
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
[email protected]

Reply via email to