libdwfl: linux-pid-attach.c (pid_next_thread): Use rewinddir on first call.

dwfl_getthreads would otherwise fail to report any threads after it was
called once.

Reported-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
This commit is contained in:
Mark Wielaard
2013-12-17 10:37:29 +01:00
parent 14c2d9e614
commit c76b2ff3ee
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -1,3 +1,8 @@
2013-12-17 Mark Wielaard <mjw@redhat.com>
* linux-pid-attach.c (pid_next_thread): Call rewinddir on first
traversal.
2013-12-16 Mark Wielaard <mjw@redhat.com>
* libdwfl.h (dwfl_module_getsymtab_first_global): New function
+3
View File
@@ -164,6 +164,9 @@ pid_next_thread (Dwfl *dwfl __attribute__ ((unused)), void *dwfl_arg,
{
struct pid_arg *pid_arg = dwfl_arg;
struct dirent *dirent;
/* Start fresh on first traversal. */
if (*thread_argp == NULL)
rewinddir (pid_arg->dir);
do
{
errno = 0;