diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e283f68201..3de21c53e4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-27 Alan Hayward + + * gdb.base/interrupt-daemon-attach.c (main): Add alarm and sleep + in child. + 2019-03-26 Andrew Burgess * gdb.python/py-prettyprint.c (struct container) : New diff --git a/gdb/testsuite/gdb.base/interrupt-daemon-attach.c b/gdb/testsuite/gdb.base/interrupt-daemon-attach.c index 5dc84438dc..e8dddf81b4 100644 --- a/gdb/testsuite/gdb.base/interrupt-daemon-attach.c +++ b/gdb/testsuite/gdb.base/interrupt-daemon-attach.c @@ -43,6 +43,7 @@ main () break; default: + /* In parent process. */ while (1) { marker (); @@ -50,12 +51,18 @@ main () } } + /* In child process. */ + + /* Alarms are not inherited by child processes. Set the alarm again to stop + the test case running forever. */ + alarm (60); + /* Detach from controlling terminal. */ if (setsid () == (pid_t) -1) return 1; - for (;;) - ; + while (1) + usleep (1000); return 0; }