mirror of https://gitlab.com/ita1024/waf.git
fix the cpu detection on HPUX
This commit is contained in:
parent
fc962542f8
commit
664116ab1f
|
@ -170,9 +170,13 @@ class OptionsContext(Context.Context):
|
||||||
elif 'SC_NPROCESSORS_CONF' in os.sysconf_names:
|
elif 'SC_NPROCESSORS_CONF' in os.sysconf_names:
|
||||||
count = int(os.sysconf('SC_NPROCESSORS_CONF'))
|
count = int(os.sysconf('SC_NPROCESSORS_CONF'))
|
||||||
if not count and os.name not in ('nt', 'java'):
|
if not count and os.name not in ('nt', 'java'):
|
||||||
tmp = self.cmd_and_log(['sysctl', '-n', 'hw.ncpu'])
|
try:
|
||||||
if re.match('^[0-9]+$', tmp):
|
tmp = self.cmd_and_log(['sysctl', '-n', 'hw.ncpu'])
|
||||||
count = int(tmp)
|
except Exception:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if re.match('^[0-9]+$', tmp):
|
||||||
|
count = int(tmp)
|
||||||
if count < 1:
|
if count < 1:
|
||||||
count = 1
|
count = 1
|
||||||
elif count > 1024:
|
elif count > 1024:
|
||||||
|
|
Loading…
Reference in New Issue