starter: Wait indefinitely for charon when using --attach-gdb
This makes sure the user has time to set break points etc. before it runs charon under gdb.
This commit is contained in:
@@ -201,10 +201,14 @@ int starter_start_charon (starter_config_t *cfg, bool no_fork, bool attach_gdb)
|
|||||||
default:
|
default:
|
||||||
/* father */
|
/* father */
|
||||||
_charon_pid = pid;
|
_charon_pid = pid;
|
||||||
if (attach_gdb)
|
while (attach_gdb)
|
||||||
{
|
{
|
||||||
/* don't monitor pid file if gdb is attached */
|
/* wait indefinitely if gdb is attached */
|
||||||
return 0;
|
usleep(10000);
|
||||||
|
if (stat(pid_file, &stb) == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < 500 && _charon_pid; i++)
|
for (i = 0; i < 500 && _charon_pid; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user