summaryrefslogtreecommitdiff
path: root/src/libmach/darwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmach/darwin.c')
-rw-r--r--src/libmach/darwin.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libmach/darwin.c b/src/libmach/darwin.c
index c443a4fba..63abde313 100644
--- a/src/libmach/darwin.c
+++ b/src/libmach/darwin.c
@@ -222,12 +222,21 @@ addpid(int pid, int force)
// The excthread reads that port and signals
// us if we are waiting on that thread.
pthread_t p;
+ int err;
excport = mach_reply_port();
pthread_mutex_init(&mu, nil);
pthread_cond_init(&cond, nil);
- pthread_create(&p, nil, excthread, nil);
- pthread_create(&p, nil, waitthread, (void*)(uintptr)pid);
+ err = pthread_create(&p, nil, excthread, nil);
+ if (err != 0) {
+ fprint(2, "pthread_create failed: %s\n", strerror(err));
+ abort();
+ }
+ err = pthread_create(&p, nil, waitthread, (void*)(uintptr)pid);
+ if (err != 0) {
+ fprint(2, "pthread_create failed: %s\n", strerror(err));
+ abort();
+ }
first = 0;
}