Salome HOME
Copyright update 2021
[modules/kernel.git] / src / Launcher / Launcher_Job_Command.cxx
index b71d7373534db4fc3b575fbfd68c411c3c06476b..eb86061b8cc58b0a151e574753f0f36c12d9ed30 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2017  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2009-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -29,6 +29,7 @@
 #ifdef WIN32
 #include <io.h>
 #define _chmod chmod
+#include <process.h>
 #endif
 
 #include <sstream>
@@ -62,7 +63,11 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l
   // File name
   std::string launch_date_port_file = launch_date;
   std::ostringstream str_pid;
+#ifdef WIN32
+  str_pid << _getpid();
+#else
   str_pid << ::getpid();
+#endif
   std::string launch_script = Kernel_Utils::GetTmpDir() + "runCommand_"
                               + _job_file_name + "_" + launch_date + "-"
                               + str_pid.str();