freebsd-ports/sysutils/byobu/files/patch-usr_lib_byobu_cpu__count
Kevin Bowling 298fdc2dd2 sysutils/byobu: Improve FreeBSD compatibility
PR:		254565
Approved by:	Justin Coffman <jcoffman@xsecure.io> (maintainer)
2021-04-08 12:55:20 -07:00

13 lines
397 B
Text

--- usr/lib/byobu/cpu_count.orig 2016-04-07 22:05:52 UTC
+++ usr/lib/byobu/cpu_count
@@ -25,7 +25,9 @@ __cpu_count_detail() {
__cpu_count() {
local c
- c=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo)
+ c=$(getconf _NPROCESSORS_ONLN 2>/dev/null || \
+ grep -ci "^processor" /proc/cpuinfo || \
+ sysctl -n hw.ncpu)
[ "$c" = "1" ] || printf "%sx" "$c"
}