Use thread_info and inferior pointers more throughout
[deliverable/binutils-gdb.git] / gdb / linux-fork.c
index 0ae213c8254ee0d95eeb97cd38de3b4f4708ff17..ae5a04b10d3fdc9d5e0e68d8cedd95bf818d46e5 100644 (file)
@@ -535,10 +535,11 @@ Please switch to another checkpoint before deleting the current one"));
 
   /* If fi->parent_ptid is not a part of lwp but it's a part of checkpoint
      list, waitpid the ptid.
-     If fi->parent_ptid is a part of lwp and it is stoped, waitpid the
+     If fi->parent_ptid is a part of lwp and it is stopped, waitpid the
      ptid.  */
-  if ((!find_thread_ptid (pptid) && find_fork_ptid (pptid))
-      || (find_thread_ptid (pptid) && is_stopped (pptid)))
+  thread_info *parent = find_thread_ptid (pptid);
+  if ((parent == NULL && find_fork_ptid (pptid))
+      || (parent != NULL && parent->state == THREAD_STOPPED))
     {
       if (inferior_call_waitpid (pptid, ptid_get_pid (ptid)))
         warning (_("Unable to wait pid %s"), target_pid_to_str (ptid));
This page took 0.025211 seconds and 4 git commands to generate.