@@ -91,13 +91,13 @@ int ThreadExecutor::handleRead(int rpipe, unsigned int &result)
9191 }
9292
9393 if (type != REPORT_OUT && type != REPORT_ERROR && type != REPORT_INFO && type != CHILD_END) {
94- std::cerr << " #### You found a bug from cppcheck. \n ThreadExecutor ::handleRead error, type was:" << type << std::endl;
94+ std::cerr << " #### ThreadExecutor ::handleRead error, type was:" << type << std::endl;
9595 std::exit (0 );
9696 }
9797
9898 unsigned int len = 0 ;
9999 if (read (rpipe, &len, sizeof (len)) <= 0 ) {
100- std::cerr << " #### You found a bug from cppcheck. \n ThreadExecutor ::handleRead error, type was:" << type << std::endl;
100+ std::cerr << " #### ThreadExecutor ::handleRead error, type was:" << type << std::endl;
101101 std::exit (0 );
102102 }
103103
@@ -106,7 +106,7 @@ int ThreadExecutor::handleRead(int rpipe, unsigned int &result)
106106 char *buf = new char [len + 1 ];
107107 const ssize_t readIntoBuf = read (rpipe, buf, len);
108108 if (readIntoBuf <= 0 ) {
109- std::cerr << " #### You found a bug from cppcheck. \n ThreadExecutor ::handleRead error, type was:" << type << std::endl;
109+ std::cerr << " #### ThreadExecutor ::handleRead error, type was:" << type << std::endl;
110110 std::exit (0 );
111111 }
112112 buf[readIntoBuf] = 0 ;
@@ -183,25 +183,25 @@ unsigned int ThreadExecutor::check()
183183 if ((iFile != _files.end () || iFileSettings != _settings.project .fileSettings .end ()) && nchildren < _settings.jobs && checkLoadAverage (nchildren)) {
184184 int pipes[2 ];
185185 if (pipe (pipes) == -1 ) {
186- std::cerr << " pipe() failed: " << std::strerror (errno) << std::endl;
186+ std::cerr << " #### ThreadExecutor::check, pipe() failed: " << std::strerror (errno) << std::endl;
187187 std::exit (EXIT_FAILURE);
188188 }
189189
190190 int flags = 0 ;
191191 if ((flags = fcntl (pipes[0 ], F_GETFL, 0 )) < 0 ) {
192- std::cerr << " fcntl(F_GETFL) failed: " << std::strerror (errno) << std::endl;
192+ std::cerr << " #### ThreadExecutor::check, fcntl(F_GETFL) failed: " << std::strerror (errno) << std::endl;
193193 std::exit (EXIT_FAILURE);
194194 }
195195
196196 if (fcntl (pipes[0 ], F_SETFL, flags | O_NONBLOCK) < 0 ) {
197- std::cerr << " fcntl(F_SETFL) failed: " << std::strerror (errno) << std::endl;
197+ std::cerr << " #### ThreadExecutor::check, fcntl(F_SETFL) failed: " << std::strerror (errno) << std::endl;
198198 std::exit (EXIT_FAILURE);
199199 }
200200
201201 pid_t pid = fork ();
202202 if (pid < 0 ) {
203203 // Error
204- std::cerr << " Failed to create child process: " << std::strerror (errno) << std::endl;
204+ std::cerr << " #### ThreadExecutor::check, Failed to create child process: " << std::strerror (errno) << std::endl;
205205 std::exit (EXIT_FAILURE);
206206 } else if (pid == 0 ) {
207207 close (pipes[0 ]);
@@ -377,18 +377,18 @@ unsigned int ThreadExecutor::check()
377377 for (unsigned int i = 0 ; i < _settings.jobs ; ++i) {
378378 threadHandles[i] = (HANDLE)_beginthreadex (nullptr , 0 , threadProc, this , 0 , nullptr );
379379 if (!threadHandles[i]) {
380- std::cerr << " #### . \n ThreadExecutor ::check error, errno :" << errno << std::endl;
380+ std::cerr << " #### ThreadExecutor ::check error, errno :" << errno << std::endl;
381381 exit (EXIT_FAILURE);
382382 }
383383 }
384384
385385 const DWORD waitResult = WaitForMultipleObjects (_settings.jobs , threadHandles, TRUE , INFINITE);
386386 if (waitResult != WAIT_OBJECT_0) {
387387 if (waitResult == WAIT_FAILED) {
388- std::cerr << " #### . \n ThreadExecutor ::check wait failed, result: " << waitResult << " error: " << GetLastError () << std::endl;
388+ std::cerr << " #### ThreadExecutor ::check wait failed, result: " << waitResult << " error: " << GetLastError () << std::endl;
389389 exit (EXIT_FAILURE);
390390 } else {
391- std::cerr << " #### . \n ThreadExecutor ::check wait failed, result: " << waitResult << std::endl;
391+ std::cerr << " #### ThreadExecutor ::check wait failed, result: " << waitResult << std::endl;
392392 exit (EXIT_FAILURE);
393393 }
394394 }
@@ -398,14 +398,14 @@ unsigned int ThreadExecutor::check()
398398 DWORD exitCode;
399399
400400 if (!GetExitCodeThread (threadHandles[i], &exitCode)) {
401- std::cerr << " #### . \n ThreadExecutor ::check get exit code failed, error:" << GetLastError () << std::endl;
401+ std::cerr << " #### ThreadExecutor ::check get exit code failed, error:" << GetLastError () << std::endl;
402402 exit (EXIT_FAILURE);
403403 }
404404
405405 result += exitCode;
406406
407407 if (!CloseHandle (threadHandles[i])) {
408- std::cerr << " #### . \n ThreadExecutor ::check close handle failed, error:" << GetLastError () << std::endl;
408+ std::cerr << " #### ThreadExecutor ::check close handle failed, error:" << GetLastError () << std::endl;
409409 exit (EXIT_FAILURE);
410410 }
411411 }
0 commit comments