Commit 20359ef4 authored by legoc's avatar legoc
Browse files

Passing pid get with the getpid function on unix's

parent e6377608
......@@ -21,6 +21,15 @@
#include "../SocketException.h"
#include "../ConnectionTimeout.h"
#ifdef WIN32
#define GET_PROCESS_PID() 0
#else
#include <unistd.h>
#define GET_PROCESS_PID() ::getpid()
#endif
using namespace std;
namespace cameo {
......@@ -311,8 +320,13 @@ std::string ServicesImpl::createRemovePortRequest(int id, const std::string& nam
}
std::string ServicesImpl::createStartedUnmanagedRequest(const std::string& name) const {
// Get the pid.
long pid = GET_PROCESS_PID();
proto::StartedUnmanagedCommand command;
command.set_name(name);
command.set_pid(pid);
std::string result;
command.SerializeToString(&result);
......
......@@ -219,6 +219,7 @@ message Request {
message StartedUnmanagedCommand {
required string name = 1;
optional int32 pid = 2;
}
message TerminatedUnmanagedCommand {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment