message_bus: support ps on FreeBSD

This commit is contained in:
Michael Brown 2013-05-01 14:28:34 -04:00
parent 5f4dbd6ddc
commit 132ee8a8e2
1 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,8 @@ class MessageBus::Diagnostics
system = `uname`.strip
if system == "Darwin"
`ps -o "comm=" -p #{Process.pid}`
elsif system == "FreeBSD"
`ps -o command -p #{Process.pid}`.split("\n",2)[1].strip()
else
info = `ps -eo "%p|$|%a" | grep '^\\s*#{Process.pid}'`
info.strip.split('|$|')[1]