From: Ralf Horstmann <ralf_horstmann@mcafee.com>
Some vserver kernel emulate the init process in a way that ppid
of process 1 is 1. This lets the debugger search function go into
an endless loop.
Since pid 1 is unlikely to be a debugger, we can safely ignore
pid 1 and just quit searching when we reach pid 1 instead of 0.
---
old
|
new
|
under_debugger()
|
644 | 644 | |
645 | 645 | pid_t pid = ::getpid(); |
646 | 646 | |
647 | | while( pid != 0 ) { |
| 647 | while( pid != 0 && pid != 1 ) { |
648 | 648 | process_info pi( pid ); |
649 | 649 | |
650 | 650 | // !! ?? should we use tokenizer here instead? |