diff options
-rw-r--r-- | support/support_test_main.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/support/support_test_main.c b/support/support_test_main.c index c20c19e..f19fce5 100644 --- a/support/support_test_main.c +++ b/support/support_test_main.c @@ -195,16 +195,14 @@ run_test_function (int argc, char **argv, const struct test_config *config) char *gdb_script_name; int inside_container = 0; - mypid = getpid(); - if (mypid < 3) + const char *outside_pid = getenv("PID_OUTSIDE_CONTAINER"); + if (outside_pid) { - const char *outside_pid = getenv("PID_OUTSIDE_CONTAINER"); - if (outside_pid) - { - mypid = atoi (outside_pid); - inside_container = 1; - } + mypid = atoi (outside_pid); + inside_container = 1; } + else + mypid = getpid(); gdb_script_name = (char *) xmalloc (strlen (argv[0]) + strlen (".gdb") + 1); sprintf (gdb_script_name, "%s.gdb", argv[0]); |