Whamcloud - gitweb
More HP patch merging; part of misc_sfs_build_changes.patch
authorphil <phil>
Tue, 1 Mar 2005 01:12:36 +0000 (01:12 +0000)
committerphil <phil>
Tue, 1 Mar 2005 01:12:36 +0000 (01:12 +0000)
b=5785
Info:
        Also correct a logic bug in the number of cpus calculation which
        can lead to a shell error if the egrep fails and thus reports no
        output.

build/lustre.spec.in

index eeeae23..6904395 100644 (file)
@@ -73,7 +73,7 @@ Configures openldap server for LDAP Lustre config database
 %build
 # if RPM_BUILD_NCPUS unset, set it
 if [ -z "$RPM_BUILD_NCPUS" ] ; then
-    RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
+    RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
     if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
         RPM_BUILD_NCPUS=1
     fi