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

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

diff --git a/nbd-server.c b/nbd-server.c
index d7d9c62..d783051 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


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to