From 97745ef09fe05a0c168aee9a5139c719f412433a Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 8 Oct 2014 16:21:13 +0000
Subject: use nproc instead of /proc


diff --git a/redoflacs b/redoflacs
index 829406a..4c15e15 100755
--- a/redoflacs
+++ b/redoflacs
@@ -1554,25 +1554,9 @@ _find_cores()
 	# Set up global variable
 	declare -gi jobs='2'                  # By default, set $jobs to '2'
 	declare -g  jobs_display='(Default)'  # Default $jobs determination
-
-	# Check /proc/cpuinfo if /proc is mounted by comparing device numbers to /
-	if (( $(stat -c %d '/proc') != $(stat -c %d '/') )); then
-		if [[ -f '/proc/cpuinfo' ]]; then
-			# /proc/cpuinfo exists, find total number of cores to use
-			#--
-			# Store contents of /proc/cpuinfo into core_array
-			mapfile -n0 -t cores_array < /proc/cpuinfo
-
-			for i in "${cores_array[@]}"; do
-				# For each line, add processor number to jobs if matched
-				#--
-				[[ "${i}" == 'processor'*:' '* ]] && jobs="${i#processor*: }"
-			done
-
-			((jobs++))  # +1 to $jobs since 'processor' starts at '0'
-			jobs_display='(/proc/cpuinfo)'  # $jobs dynamically determined
-		fi
-	fi
+	
+	jobs=`nproc`
+	jobs_display='(nproc)'
 }
 
 #-------------------------------------------------------------------------------
-- 
1.8.3.4

