From: rnv Date: Thu, 14 Jul 2011 07:42:21 +0000 (+0000) Subject: Porting SALOME 6.3.1 on Win 32 platform. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=594ae9537829a57e4bcd304b233369497a2ab65e;p=modules%2Fkernel.git Porting SALOME 6.3.1 on Win 32 platform. --- diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 99c092c1f..bf7ee48df 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -208,7 +208,7 @@ def killMyPort(port): try: if sys.platform == "win32": import win32pm - win32pm.killpid(int(pid),0) + win32pm.killpid(int(pid),0) else: os.kill(int(pid),signal.SIGKILL) pass @@ -265,9 +265,14 @@ def killNotifdAndClean(port): def killMyPortSpy(pid, port): dt = 1.0 while 1: - from os import kill try: - kill(int(pid), 0) + if sys.platform != "win32": + from os import kill + win32pm.killpid(int(pid),0) + else: + from win32pm import killpid + if killpid(int(pid), 0) != 0: + return except OSError, e: if e.errno != 3: return diff --git a/bin/runSalome.py b/bin/runSalome.py index 62b19a4f4..e8dd6845c 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -984,8 +984,11 @@ def foreGround(clt, args): port = getPortNumber() # -- server = Server({}) - server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(os.getpid()), "%s"%(port)] - server.run() + if sys.platform == "win32": + server.CMD = [os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", "--spy", "%s"%(os.getpid()), "%s"%(port)] + else: + server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(os.getpid()), "%s"%(port)] + server.run() # os.system("killSalomeWithPort.py --spy %s %s &"%(os.getpid(), port)) # -- dt = 1.0