* src/gdb/target.h: Remove all tests for already defined
[deliverable/binutils-gdb.git] / gdb / linux-nat.c
index 3cfc2b2228091ac3042e8bdeeb7e3b48fae42c66..22d721a5183445acec9119b2fd4973380a9c7f59 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
@@ -3260,8 +3261,6 @@ linux_xfer_siginfo (struct target_ops *ops, enum target_object object,
                     const char *annex, gdb_byte *readbuf,
                    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
-  struct lwp_info *lp;
-  LONGEST n;
   int pid;
   struct siginfo siginfo;
   gdb_byte inf_siginfo[sizeof (struct siginfo)];
@@ -4163,7 +4162,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.023891 seconds and 4 git commands to generate.