From 104dc8e665c8b7f1f397b8dfbec4c3060ef12a0c Mon Sep 17 00:00:00 2001
From: Vadim Penzin <vadimp@users.sf.net>
Date: Tue, 28 Oct 2014 18:09:26 -0400
Subject: [PATCH 03/28] Fixed incorrect check of the result of getpeername(2)

From https://sourceforge.net/p/trousers/trousers/ci/104dc8e665c8b7f1f397b8dfbec4c3060ef12a0c/
---
 src/tcs/rpc/tcstp/rpc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tcs/rpc/tcstp/rpc.c b/src/tcs/rpc/tcstp/rpc.c
index 0fc7e83..a235a84 100644
--- a/src/tcs/rpc/tcstp/rpc.c
+++ b/src/tcs/rpc/tcstp/rpc.c
@@ -524,7 +524,8 @@ access_control(struct tcsd_thread_data *thread_data)
 	struct sockaddr *sa;
 	socklen_t sas_len = sizeof(sas);
 
-	if (!getpeername(thread_data->sock, (struct sockaddr *)&sas, &sas_len)) {
+	if (getpeername(thread_data->sock, (struct sockaddr *)&sas,
+			&sas_len) == -1) {
 		LogError("Error retrieving local socket address: %s", strerror(errno));
 		return 1;
 	}
-- 
1.8.3.1

