From 4a62eb46b53269399adcd1231381b9d3878b705a Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Fri, 25 Apr 2008 07:42:11 +0000
Subject: [PATCH] Use gSystem->GetPid instead of the non portable getpid

git-svn-id: http://root.cern.ch/svn/root/trunk@23545 27541ba8-7e3a-0410-8455-c3a389f83636
---
 roofit/roofitcore/src/RooMsgService.cxx | 5 +++--
 roofit/roofitcore/src/RooRealMPFE.cxx   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/roofit/roofitcore/src/RooMsgService.cxx b/roofit/roofitcore/src/RooMsgService.cxx
index 63e2bdc641a..eb550fd88bf 100644
--- a/roofit/roofitcore/src/RooMsgService.cxx
+++ b/roofit/roofitcore/src/RooMsgService.cxx
@@ -52,6 +52,7 @@
 #include "RooGlobalFunc.h"
 #include "RooSentinel.h"
 
+#include "TSystem.h"
 #include "Riostream.h"
 #include <iomanip>
 #include <fstream>
@@ -399,7 +400,7 @@ ostream& RooMsgService::log(const RooAbsArg* self, MsgLevel level, MsgTopic topi
     
   if (_streams[as].prefix && !skipPrefix) {
     if (_showPid) {
-      (*_streams[as].os) << "pid" << getpid() << " " ;
+      (*_streams[as].os) << "pid" << gSystem->GetPid() << " " ;
     }
     (*_streams[as].os) << "[#" << as << "] " << _levelNames[level] << ":" << _topicNames[topic]  << " -- " ;
   }
@@ -424,7 +425,7 @@ ostream& RooMsgService::log(const TObject* self, MsgLevel level, MsgTopic topic,
     
   if (_streams[as].prefix && !skipPrefix) {
     if (_showPid) {
-      (*_streams[as].os) << "pid" << getpid() << " " ;
+      (*_streams[as].os) << "pid" << gSystem->GetPid() << " " ;
     }
     (*_streams[as].os) << "[#" << as << "] " << _levelNames[level] << ":" << _topicNames[topic]  << " -- " ;
   }
diff --git a/roofit/roofitcore/src/RooRealMPFE.cxx b/roofit/roofitcore/src/RooRealMPFE.cxx
index dbcba692ea7..43eb5a0f6ca 100644
--- a/roofit/roofitcore/src/RooRealMPFE.cxx
+++ b/roofit/roofitcore/src/RooRealMPFE.cxx
@@ -140,7 +140,7 @@ void RooRealMPFE::initialize() {
   _pid = fork() ;
   if (_pid==0) {
 
-    cout << "child getpid = " << getpid() << endl ;
+    cout << "child getpid = " << gSystem->GetPid() << endl ;
 
     // Start server loop 
     _state = Server ;
@@ -153,7 +153,7 @@ void RooRealMPFE::initialize() {
 
   } else if (_pid>0) {
  
-    cout << "parent getpid = " << getpid() << endl ;
+    cout << "parent getpid = " << gSystem->GetPid() << endl ;
    
     // Client process - fork successul
     cout << "RooRealMPFE::initialize(" << GetName() 
-- 
GitLab