[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Nbd] [PATCH 3/3] nbd-server: const'd function parameter variable



Making the parameter variable const revealed a smelly assignment
statement which was deemed unnecessary and hence removed.

Signed-off-by: Tuomas Räsänen <tuomasjjrasanen@...1261...>
---
 nbd-server.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nbd-server.c b/nbd-server.c
index 34b064e..1cd25bc 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -2354,7 +2354,7 @@ handler_err:
 }
 
 static void
-handle_oldstyle_connection(GArray *servers, SERVER *serve)
+handle_oldstyle_connection(GArray *const servers, SERVER *const serve)
 {
 	int net;
 	CLIENT *client = NULL;
@@ -2427,8 +2427,7 @@ handle_oldstyle_connection(GArray *servers, SERVER *serve)
 		g_hash_table_destroy(children);
 		children = NULL;
 		for(i=0;i<servers->len;i++) {
-			serve=&g_array_index(servers, SERVER, i);
-			close(serve->socket);
+			close(g_array_index(servers, SERVER, i).socket);
 		}
 		/* FALSE does not free the
 		   actual data. This is required,
-- 
1.7.10.4




Reply to: