* [PATCH] opensm: Fix pthread_create() return value checks
@ 2012-06-07 19:16 Bart Van Assche
[not found] ` <4FD0FE27.6080700-HInyCGIudOg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2012-06-07 19:16 UTC (permalink / raw)
To: Alex Netes, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Just like other POSIX thread functions, pthread_create() either returns zero
or a positive error code. Found this through source code review. See also
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_create.html
Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
---
complib/cl_threadpool.c | 2 +-
libvendor/osm_vendor_ibumad.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/complib/cl_threadpool.c b/complib/cl_threadpool.c
index 4440808..0f6498b 100644
--- a/complib/cl_threadpool.c
+++ b/complib/cl_threadpool.c
@@ -105,7 +105,7 @@ cl_status_t cl_thread_pool_init(IN cl_thread_pool_t * const p_thread_pool,
for (i = 0; i < count; i++) {
if (pthread_create(&p_thread_pool->tid[i], NULL,
- thread_pool_routine, p_thread_pool) < 0) {
+ thread_pool_routine, p_thread_pool) != 0) {
cl_thread_pool_destroy(p_thread_pool);
return CL_INSUFFICIENT_RESOURCES;
}
diff --git a/libvendor/osm_vendor_ibumad.c b/libvendor/osm_vendor_ibumad.c
index 9b7168b..bb40e8b 100644
--- a/libvendor/osm_vendor_ibumad.c
+++ b/libvendor/osm_vendor_ibumad.c
@@ -425,7 +425,7 @@ static int umad_receiver_start(osm_vendor_t * p_vend)
p_ur->p_vend = p_vend;
p_ur->p_log = p_vend->p_log;
- if (pthread_create(&p_ur->tid, NULL, umad_receiver, p_ur) < 0)
+ if (pthread_create(&p_ur->tid, NULL, umad_receiver, p_ur) != 0)
return -1;
return 0;
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] opensm: Fix pthread_create() return value checks
[not found] ` <4FD0FE27.6080700-HInyCGIudOg@public.gmane.org>
@ 2012-06-13 11:45 ` Alex Netes
0 siblings, 0 replies; 2+ messages in thread
From: Alex Netes @ 2012-06-13 11:45 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hi Bart,
On 19:16 Thu 07 Jun , Bart Van Assche wrote:
> Just like other POSIX thread functions, pthread_create() either returns zero
> or a positive error code. Found this through source code review. See also
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_create.html
>
> Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
> ---
Applied. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-13 11:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07 19:16 [PATCH] opensm: Fix pthread_create() return value checks Bart Van Assche
[not found] ` <4FD0FE27.6080700-HInyCGIudOg@public.gmane.org>
2012-06-13 11:45 ` Alex Netes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox