> -----Original Message----- > From: dev [mailto:[email protected]] On Behalf Of Jacek Piasecki > Sent: Thursday, October 12, 2017 1:45 PM > To: [email protected] > Cc: Richardson, Bruce <[email protected]>; Van Haaren, Harry > <[email protected]>; Mcnamara, John > <[email protected]>; Piasecki, JacekX > <[email protected]>; [email protected]; [email protected] > Subject: [dpdk-dev] [PATCH] examples/performance-thread: fix return check > > There was a call for thread create function without result check. > Added result check and message printout after failure. > > Coverity issue: 143441 > Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim > app") > Cc: [email protected] > Cc: [email protected] > > Signed-off-by: Jacek Piasecki <[email protected]> > --- > examples/performance-thread/pthread_shim/main.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/examples/performance-thread/pthread_shim/main.c > b/examples/performance-thread/pthread_shim/main.c > index 850b009..febae39 100644 > --- a/examples/performance-thread/pthread_shim/main.c > +++ b/examples/performance-thread/pthread_shim/main.c > @@ -161,6 +161,7 @@ static void initial_lthread(void *args > __attribute__((unused))) > pthread_override_set(1); > > uint64_t i; > + int ret; > > /* initialize mutex for shared counter */ > print_count = 0; > @@ -187,7 +188,10 @@ static void initial_lthread(void *args > __attribute__((unused))) > pthread_attr_setaffinity_np(&attr, sizeof(rte_cpuset_t), > &cpuset); > > /* create the thread */ > - pthread_create(&tid[i], &attr, helloworld_pthread, (void *) > i); > + ret = pthread_create(&tid[i], &attr, > + helloworld_pthread, (void *) i); > + if (ret != 0) > + rte_exit(EXIT_FAILURE, "Cannot create helloworld > thread\n"); > } > > /* wait for 1s to allow threads > -- > 1.9.1
Acked-by: Michal Jastrzebski <[email protected]>

