* linux-nat.c (linux_nat_filter_event): Minor comment reformatting.
[deliverable/binutils-gdb.git] / gdb / linux-nat.c
index 3cfc2b2228091ac3042e8bdeeb7e3b48fae42c66..0679173764cf3f6593b3b930ef081d8f3f862f6e 100644 (file)
@@ -2623,9 +2623,9 @@ linux_nat_filter_event (int lwpid, int status, int options)
   /* Check if the thread has exited.  */
   if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1)
     {
-      /* If this is the main thread, we must stop all threads and
-        verify if they are still alive.  This is because in the nptl
-        thread model, there is no signal issued for exiting LWPs
+      /* If this is the main thread, we must stop all threads and verify
+        if they are still alive.  This is because in the nptl thread model
+        on Linux 2.4, there is no signal issued for exiting LWPs
         other than the main thread.  We only get the main thread exit
         signal once all child threads have already exited.  If we
         stop all the threads and use the stop_wait_callback to check
@@ -2644,13 +2644,14 @@ linux_nat_filter_event (int lwpid, int status, int options)
                            "LLW: %s exited.\n",
                            target_pid_to_str (lp->ptid));
 
-      exit_lwp (lp);
-
-      /* If there is at least one more LWP, then the exit signal was
-        not the end of the debugged application and should be
-        ignored.  */
-      if (num_lwps > 0)
-       return NULL;
+      if (num_lwps > 1)
+       {
+        /* If there is at least one more LWP, then the exit signal
+           was not the end of the debugged application and should be
+           ignored.  */
+        exit_lwp (lp);
+        return NULL;
+       }
     }
 
   /* Check if the current LWP has previously exited.  In the nptl
@@ -4163,7 +4164,7 @@ linux_nat_xfer_osdata (struct target_ops *ops, enum target_object object,
              char procentry[sizeof ("/proc/4294967295")];
 
              if (!isdigit (dp->d_name[0])
-                 || strlen (dp->d_name) > sizeof ("4294967295") - 1)
+                 || NAMELEN (dp) > sizeof ("4294967295") - 1)
                continue;
 
              sprintf (procentry, "/proc/%s", dp->d_name);
This page took 0.024276 seconds and 4 git commands to generate.