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 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 ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Nbd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nbd-general
