summaryrefslogtreecommitdiff
path: root/src/libmach/darwin.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-03 16:54:30 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-03 16:54:30 +0200
commit28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch)
tree32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/libmach/darwin.c
parente836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff)
downloadgolang-upstream/59.tar.gz
Imported Upstream version 59upstream/59
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;
}