From f3fe7af6ed4004b084426d4049469c31f49126a8 Mon Sep 17 00:00:00 2001
From: Corentin Chary <corentin.chary@gmail.com>
Date: Tue, 16 Feb 2010 11:40:06 +0100
Subject: [PATCH] pkcs11-daemon: pthread_create returns 0 on success

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
---
 gck-rpc-dispatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gck-rpc-dispatch.c b/gck-rpc-dispatch.c
index 6d36115..2ae87b7 100644
--- a/gck-rpc-dispatch.c
+++ b/gck-rpc-dispatch.c
@@ -2191,7 +2191,7 @@ void gck_rpc_layer_accept(void)
 
 	error = pthread_create(&ds->thread, NULL,
 			       run_dispatch_thread, &(ds->socket));
-	if (!error) {
+	if (error) {
 		gck_rpc_warn("couldn't start thread: %s", strerror(errno));
 		close(new_fd);
 		free(ds);
-- 
GitLab