Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/OperatingSystems/FreeBSD.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ public function getCpuCount(): int {
$numCpu = -1;

try {
$numCpu = intval($this->executeCommand('sysctl -n hw.ncpu')); //TODO: this should be tested if it actually works on FreeBSD
$numCpu = intval($this->executeCommand('/sbin/sysctl -n hw.ncpu'));
} catch (RuntimeException) {
return $numCpu;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return $numCpu;

Should be unnecessary since we're pre-initializing $numCpu and returning it anyhow at the end of the function, but also doesn't hurt. I see we're doing this elsewhere already so I guess leave it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my thought process. It should be consistent with the rest. Or all of the exception returns should be removed.

}

return $numCpu;
Expand Down
Loading