]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: linux-pid-attach.c (pid_next_thread): Use rewinddir on first call.
authorMark Wielaard <mjw@redhat.com>
Tue, 17 Dec 2013 09:37:29 +0000 (10:37 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 17 Dec 2013 09:37:29 +0000 (10:37 +0100)
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>
libdwfl/ChangeLog
libdwfl/linux-pid-attach.c

index 67f1fcff124fab2495f1ff8a517b2d706538066f..76538e64dac81ce29c078271a18be2cd04b9b2b8 100644 (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
index 45a0732d16ef0dfef3707fe84873b114ec66d0d1..3d0716abd7d46b489fa8a0c0cab9f505edff5b16 100644 (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;