Now checks the return value of wait_for_thread() and print out an error message if it fails.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19804 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -83,14 +83,24 @@ main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
status_t status;
|
||||
while (wait_for_thread(childA, &status) == B_INTERRUPTED)
|
||||
;
|
||||
result = status;
|
||||
status_t status, returnValue = 0;
|
||||
do {
|
||||
status = wait_for_thread(childA, &returnValue);
|
||||
} while (status == B_INTERRUPTED);
|
||||
|
||||
while (wait_for_thread(childB, &status) == B_INTERRUPTED)
|
||||
;
|
||||
result += status;
|
||||
if (status == B_OK)
|
||||
result = returnValue;
|
||||
else
|
||||
fprintf(stderr, "wait_for_thread(%ld) A failed: %s\n", childA, strerror(status));
|
||||
|
||||
do {
|
||||
status = wait_for_thread(childB, &returnValue);
|
||||
} while (status == B_INTERRUPTED);
|
||||
|
||||
if (status == B_OK)
|
||||
result += returnValue;
|
||||
else
|
||||
fprintf(stderr, "wait_for_thread(%ld) B failed: %s\n", childB, strerror(status));
|
||||
}
|
||||
|
||||
if (silent) {
|
||||
|
||||
@@ -70,14 +70,24 @@ main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
status_t status;
|
||||
while (wait_for_thread(childA, &status) == B_INTERRUPTED)
|
||||
;
|
||||
result = status;
|
||||
status_t status, returnValue = 0;
|
||||
do {
|
||||
status = wait_for_thread(childA, &returnValue);
|
||||
} while (status == B_INTERRUPTED);
|
||||
|
||||
while (wait_for_thread(childB, &status) == B_INTERRUPTED)
|
||||
;
|
||||
result += status;
|
||||
if (status == B_OK)
|
||||
result = returnValue;
|
||||
else
|
||||
fprintf(stderr, "wait_for_thread(%ld) A failed: %s\n", childA, strerror(status));
|
||||
|
||||
do {
|
||||
status = wait_for_thread(childB, &returnValue);
|
||||
} while (status == B_INTERRUPTED);
|
||||
|
||||
if (status == B_OK)
|
||||
result += returnValue;
|
||||
else
|
||||
fprintf(stderr, "wait_for_thread(%ld) B failed: %s\n", childB, strerror(status));
|
||||
}
|
||||
|
||||
if (gForked) {
|
||||
|
||||
@@ -71,13 +71,24 @@ main(int argc, char *argv[])
|
||||
resume_thread(threadA);
|
||||
resume_thread(threadB);
|
||||
|
||||
while (wait_for_thread(threadA, &status) == B_INTERRUPTED)
|
||||
;
|
||||
result = status;
|
||||
status_t returnValue = 0;
|
||||
do {
|
||||
status = wait_for_thread(threadA, &returnValue);
|
||||
} while (status == B_INTERRUPTED);
|
||||
|
||||
while (wait_for_thread(threadB, &status) == B_INTERRUPTED)
|
||||
;
|
||||
result += status;
|
||||
if (status == B_OK)
|
||||
result = returnValue;
|
||||
else
|
||||
fprintf(stderr, "wait_for_thread(%ld) A failed: %s\n", threadA, strerror(status));
|
||||
|
||||
do {
|
||||
status = wait_for_thread(threadB, &returnValue);
|
||||
} while (status == B_INTERRUPTED);
|
||||
|
||||
if (status == B_OK)
|
||||
result += returnValue;
|
||||
else
|
||||
fprintf(stderr, "wait_for_thread(%ld) B failed: %s\n", threadB, strerror(status));
|
||||
}
|
||||
|
||||
if (silent) {
|
||||
|
||||
Reference in New Issue
Block a user