On error, pthread_create() returns a positive number (errno).
Fix the test on the return value.
Fixes:
af1475918124 ("vhost: introduce API to start a specific driver")
Fixes:
e623e0c6d8a5 ("vhost: add reconnect ability")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
ret = pthread_create(&reconn_tid, NULL,
vhost_user_client_reconnect, NULL);
ret = pthread_create(&reconn_tid, NULL,
vhost_user_client_reconnect, NULL);
RTE_LOG(ERR, VHOST_CONFIG, "failed to create reconnect thread");
if (pthread_mutex_destroy(&reconn_list.mutex)) {
RTE_LOG(ERR, VHOST_CONFIG,
RTE_LOG(ERR, VHOST_CONFIG, "failed to create reconnect thread");
if (pthread_mutex_destroy(&reconn_list.mutex)) {
RTE_LOG(ERR, VHOST_CONFIG,
if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
vsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT);
if (vsocket->reconnect && reconn_tid == 0) {
if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
vsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT);
if (vsocket->reconnect && reconn_tid == 0) {
- if (vhost_user_reconnect_init() < 0) {
+ if (vhost_user_reconnect_init() != 0)
}
} else {
vsocket->is_server = true;
}
} else {
vsocket->is_server = true;
if (fdset_tid == 0) {
int ret = pthread_create(&fdset_tid, NULL, fdset_event_dispatch,
&vhost_user.fdset);
if (fdset_tid == 0) {
int ret = pthread_create(&fdset_tid, NULL, fdset_event_dispatch,
&vhost_user.fdset);
RTE_LOG(ERR, VHOST_CONFIG,
"failed to create fdset handling thread");
}
RTE_LOG(ERR, VHOST_CONFIG,
"failed to create fdset handling thread");
}