[PATCH] fix a test case in socket-wrapper

Michael Adam obnox at samba.org
Fri Mar 17 08:17:36 UTC 2017


See attached patch.
Review / push welcome.

Cheers - Michael
-------------- next part --------------
From 1296b19dbe6acb0150c4ecc355350adba69792d9 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Thu, 16 Mar 2017 11:18:28 +0000
Subject: [PATCH] tests: Fix test_close_failure test case

Found by valgrind.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 tests/test_close_failure.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/test_close_failure.c b/tests/test_close_failure.c
index 0c9d6a7..8a6d40e 100644
--- a/tests/test_close_failure.c
+++ b/tests/test_close_failure.c
@@ -23,14 +23,12 @@ static int teardown(void **state)
 static void test_close_failure(void **state)
 {
 	int s;
-	int rc;
 
 	(void) state; /* unused */
-	(void) s; /*set but not used */
 
 	s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
 
-	assert_int_not_equal(rc, -1);
+	assert_int_not_equal(s, -1);
 
 	/* Do not close the socket here so that destructor
 	 * handles it and no hang should be observed.*/
-- 
2.9.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170317/2b7fa7f3/signature.sig>


More information about the samba-technical mailing list