diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index 6afc08fd5..229c9ce7a 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -261,11 +261,11 @@ unsigned int ThreadExecutor::check() return result; } -void ThreadExecutor::writeToPipe(char type, const std::string &data) +void ThreadExecutor::writeToPipe(PipeSignal type, const std::string &data) { - unsigned int len = data.length() + 1; + unsigned int len = static_cast(data.length() + 1); char *out = new char[ len + 1 + sizeof(len)]; - out[0] = type; + out[0] = static_cast(type); std::memcpy(&(out[1]), &len, sizeof(len)); std::memcpy(&(out[1+sizeof(len)]), data.c_str(), len); if (write(_wpipe, out, len + 1 + sizeof(len)) <= 0) { diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index e0349f1a9..c91382456 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -65,6 +65,8 @@ private: #ifdef THREADING_MODEL_FORK private: + enum PipeSignal {REPORT_OUT='1',REPORT_ERROR='2', CHILD_END='3'}; + /** * Read from the pipe, parse and handle what ever is in there. *@return -1 in case of error @@ -72,14 +74,14 @@ private: * 1 if we did read something */ int handleRead(int rpipe, unsigned int &result); - void writeToPipe(char type, const std::string &data); + void writeToPipe(PipeSignal type, const std::string &data); /** * Write end of status pipe, different for each child. * Not used in master process. */ int _wpipe; std::list _errorList; - enum PipeSignal {REPORT_OUT='1',REPORT_ERROR='2', CHILD_END='3'}; + public: /** * @return true if support for threads exist.