Commit aa17f615 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

vhost: check != 0 for pthread_create() return value



pthread_create() returns a positive errno when it fails, so the "rc < 0"
check was invalid - it needs to be "rc != 0".

Note: found while debugging an LTO compilation warning related to this
function.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: If232d8c4aa113d6f3f8049f3bc8f5fd0c197d052
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23304


Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
parent 13bb2619
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1987,7 +1987,7 @@ vhost_user_fini(spdk_vhost_fini_cb vhost_cb)
	 * a separate thread to avoid deadlock.
	 */
	rc = pthread_create(&tid, NULL, &vhost_user_session_shutdown, vhost_cb);
	if (rc < 0) {
	if (rc != 0) {
		SPDK_ERRLOG("Failed to start session shutdown thread (%d): %s\n", rc, spdk_strerror(rc));
		abort();
	}