eal: fix check when retrieving current CPU affinity
authorDavid Marchand <david.marchand@redhat.com>
Tue, 19 Feb 2019 20:38:13 +0000 (21:38 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 7 Mar 2019 15:37:14 +0000 (16:37 +0100)
commitb206376438f1cb2ccd389f3be4e6b2e459c99ea9
tree09adf4071f3f7d4256eea977c08de404802977b3
parente892fa595e19b5cce315045444b3b7e31130ef19
eal: fix check when retrieving current CPU affinity

pthread_getaffinity_np returns a >0 value when failing.

This is mainly for the sake of correctness.
The only case where it could fail is when passing an incorrect cpuset
size wrt to the kernel.

Fixes: 2eba8d21f3c9 ("eal: restrict cores auto detection")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
lib/librte_eal/common/eal_common_options.c