Commit e1363dc2 authored by Pavel Vainerman's avatar Pavel Vainerman

Добавил waitpid у порождающих потоки программ.

parent 1dc99be6
#include <sys/wait.h>
#include <sstream> #include <sstream>
#include "MBTCPMaster.h" #include "MBTCPMaster.h"
#include "Configuration.h" #include "Configuration.h"
...@@ -69,6 +70,7 @@ int main( int argc, const char** argv ) ...@@ -69,6 +70,7 @@ int main( int argc, const char** argv )
dlog(Debug::ANY) << "\n\n\n"; dlog(Debug::ANY) << "\n\n\n";
dlog[Debug::ANY] << "(main): -------------- MBTCP Exchange START -------------------------\n\n"; dlog[Debug::ANY] << "(main): -------------- MBTCP Exchange START -------------------------\n\n";
act.run(false); act.run(false);
while( waitpid(-1, 0, 0) > 0 );
return 0; return 0;
} }
catch( Exception& ex ) catch( Exception& ex )
...@@ -80,5 +82,6 @@ int main( int argc, const char** argv ) ...@@ -80,5 +82,6 @@ int main( int argc, const char** argv )
dlog[Debug::CRIT] << "(mbtcpmaster): catch ..." << std::endl; dlog[Debug::CRIT] << "(mbtcpmaster): catch ..." << std::endl;
} }
while( waitpid(-1, 0, 0) > 0 );
return 1; return 1;
} }
#include <sys/wait.h>
#include <sstream> #include <sstream>
#include "ObjectsActivator.h" #include "ObjectsActivator.h"
#include "Extensions.h" #include "Extensions.h"
...@@ -68,8 +69,8 @@ int main( int argc, char** argv ) ...@@ -68,8 +69,8 @@ int main( int argc, char** argv )
dlog[Debug::ANY] << "(main): -------------- RTU Exchange START -------------------------\n\n"; dlog[Debug::ANY] << "(main): -------------- RTU Exchange START -------------------------\n\n";
act.run(false); act.run(false);
// msleep(500);
// rs->execute(); while( waitpid(-1, 0, 0) > 0 );
return 0; return 0;
} }
catch( Exception& ex ) catch( Exception& ex )
...@@ -81,5 +82,6 @@ int main( int argc, char** argv ) ...@@ -81,5 +82,6 @@ int main( int argc, char** argv )
dlog[Debug::CRIT] << "(rtuexchange): catch ..." << std::endl; dlog[Debug::CRIT] << "(rtuexchange): catch ..." << std::endl;
} }
while( waitpid(-1, 0, 0) > 0 );
return 1; return 1;
} }
...@@ -69,7 +69,7 @@ int main( int argc, const char** argv ) ...@@ -69,7 +69,7 @@ int main( int argc, const char** argv )
dlog[Debug::ANY] << "(main): -------------- UDPReceiver START -------------------------\n\n"; dlog[Debug::ANY] << "(main): -------------- UDPReceiver START -------------------------\n\n";
act.run(false); act.run(false);
while (waitpid(-1, 0, 0)); while( waitpid(-1, 0, 0) > 0 );
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
...@@ -86,6 +86,6 @@ int main( int argc, const char** argv ) ...@@ -86,6 +86,6 @@ int main( int argc, const char** argv )
dlog[Debug::CRIT] << "(unetexchange): catch ..." << std::endl; dlog[Debug::CRIT] << "(unetexchange): catch ..." << std::endl;
} }
while (waitpid(-1, 0, 0)); while( waitpid(-1, 0, 0) > 0 );
return 0; return 0;
} }
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