* target.h: Add enum target_waitkind, enum target_signal, and
[deliverable/binutils-gdb.git] / gdb / sparcly-nat.c
index 193fa1e695a87f0e2e1c880eea40b2123bd2c976..92ab0e87cd67fc23d8106957b2e36eaed654f7d6 100644 (file)
@@ -310,10 +310,13 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
 /* Wait for child to do something.  Return pid of child, or -1 in case
    of error; store status through argument pointer STATUS.  */
 
+/* FIXME: Not sparc-specific.  Should be using lynx-nat.c instead; the
+   child_wait's are identical.  */
+
 int
 child_wait (pid, status)
      int pid;
-     int *status;
+     struct target_waitstatus *ourstatus;
 {
   int save_errno;
   int thread;
@@ -335,9 +338,11 @@ child_wait (pid, status)
        {
          if (save_errno == EINTR)
            continue;
-         fprintf (stderr, "Child process unexpectedly missing: %s.\n",
+         fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n",
                   safe_strerror (save_errno));
-         *status = 42;         /* Claim it exited with signal 42 */
+         /* Claim it exited with unknown signal.  */
+         ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
+         ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
          return -1;
        }
 
@@ -358,6 +363,8 @@ child_wait (pid, status)
 
       pid = BUILDPID (pid, thread);
 
+      store_waitstatus (ourstatus, status);
+
       return pid;
     }
 }
This page took 0.024131 seconds and 4 git commands to generate.