From e90cdf4e48937e441c49b86b95fbbcc216524e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 10 Jan 2007 10:02:46 +0000 Subject: [PATCH] fibo_load_image now notices if spawn_thread() fails, and puts a warning to stderr. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19763 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/system/kernel/fibo_load_image.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tests/system/kernel/fibo_load_image.cpp b/src/tests/system/kernel/fibo_load_image.cpp index 651ff1ed44..ceb2d93d45 100644 --- a/src/tests/system/kernel/fibo_load_image.cpp +++ b/src/tests/system/kernel/fibo_load_image.cpp @@ -56,8 +56,17 @@ main(int argc, char *argv[]) snprintf(buffer, sizeof(buffer), "%d", num - 1); thread_id threadA = load_image(argCount, (const char**)args, (const char**)environ); + if (threadA < B_OK) { + fprintf(stderr, "Could not create thread A: %s\n", strerror(threadA)); + return -1; + } + snprintf(buffer, sizeof(buffer), "%d", num - 2); thread_id threadB = load_image(argCount, (const char**)args, (const char**)environ); + if (threadB < B_OK) { + fprintf(stderr, "Could not create thread B: %s\n", strerror(threadB)); + return -1; + } resume_thread(threadA); resume_thread(threadB);