Cosmetic error reporting cleanup.
authorlace <>
Wed, 16 May 2007 17:27:51 +0000 (17:27 +0000)
committerlace <>
Wed, 16 May 2007 17:27:51 +0000 (17:27 +0000)
testsuite.c

index c569777..bcf81d1 100644 (file)
@@ -46,12 +46,19 @@ static struct attach_state_struct *attach_checked (pid_t pid, int redelivered_ex
 static void detach_checked (struct attach_state_struct *attach_state)
 {
   pid_t pid = attach_state_pid_get (attach_state);
 static void detach_checked (struct attach_state_struct *attach_state)
 {
   pid_t pid = attach_state_pid_get (attach_state);
-  int stopped = attach_state_stopped_get (attach_state);
 
 
-  /* FIXME: Why STATE_STOPPED?  */
-  STATE (pid, (stopped ? 1 << STATE_STOPPED : 1 << STATE_PTRACED));
-  detach (attach_state);
-  STATE (pid, (stopped ? 1 << STATE_STOPPED : (1 << STATE_SLEEPING) | (1 << STATE_RUNNING)));
+  if (attach_state_stopped_get (attach_state) != 0)
+    {
+      STATE (pid, 1 << STATE_STOPPED);
+      detach (attach_state);
+      STATE (pid, 1 << STATE_STOPPED);
+    }
+  else
+    {
+      STATE (pid, (1 << STATE_PTRACED));
+      detach (attach_state);
+      STATE (pid, ((1 << STATE_SLEEPING) | (1 << STATE_RUNNING)));
+    }
 }
 
 struct registry
 }
 
 struct registry