Fix the pid getter function (for centos7)