Skip to content

Commit

Permalink
Merge "Closes-Bug: #1466363 Use fork-exec and waitpid() instead of pl…
Browse files Browse the repository at this point in the history
…atform specific system() call"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 18, 2015
2 parents 68b599f + 1115733 commit ef004cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bgp/test/bgp_stress_test.cc
Expand Up @@ -2518,9 +2518,15 @@ TEST_P(BgpStressTest, RandomEvents) {
ShowAllRoutes();
ShowNeighborStatistics();

// Fork off python shell for pause. Use portable fork and exec instead of
// system() call which is platform specific, wrt signal handling.
if (d_pause_after_initial_setup_) {
BGP_DEBUG_UT("Test PAUSED. Exit (Ctrl-d) from python shell to resume");
system("/usr/bin/python");
pid_t pid;
if (!(pid = fork()))
execl("/usr/bin/python", "/usr/bin/python", NULL);
int status;
waitpid(pid, &status, 0);
}

HEAP_PROFILER_DUMP("bgp_stress_test");
Expand Down

0 comments on commit ef004cb

Please sign in to comment.