Michael Weber [Fri, 20 Nov 2009 10:05:41 +0000 (11:05 +0100)]
darwin9.c
memtime.c

index cedfb85..0cb55f5 100644 (file)
--- a/darwin9.c
+++ b/darwin9.c
 
 static task_t       child_task = MACH_PORT_NULL;
 
+extern int kid_signalled;
+
 #define CHECK_MACH_ERROR(err, msg)                                      \
-    if (err != KERN_SUCCESS) {                                          \
-        mach_error (msg, err);                                          \
-        return -1;                                                      \
-    }                                                                   \
+    do {                                                                \
+        if (err != KERN_SUCCESS) {                                      \
+            if (kid_signalled == 0) mach_error (msg, err);              \
+            return -1;                                                  \
+        }                                                               \
+    } while (0)                                                         \
 
 #ifdef _LP64
 #define vm_region vm_region_64
index 334c303..e414cf4 100644 (file)
--- a/memtime.c
+++ b/memtime.c
@@ -52,6 +52,7 @@ usage (FILE *ffile)
 
 static int print_stats;
 static pid_t kid;
+int kid_signalled = 0;
 
 static int
 xkill (pid_t kid, int signal)
@@ -59,6 +60,7 @@ xkill (pid_t kid, int signal)
      int rc = -1;
      if (kid != 0) {
           rc = kill (kid, signal);
+          kid_signalled = 1;
      }
      return rc;
 }