The new name describes better the actual usage.

Remove also the fourth parameter, CLIENT*, which was always NULL.

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

diff --git a/nbd-server.c b/nbd-server.c
index 6523051..ac5b8b7 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -2354,8 +2354,9 @@ handler_err:
 }
 
 static void
-handle_connection(GArray *servers, int net, SERVER *serve, CLIENT *client)
+handle_oldstyle_connection(GArray *servers, int net, SERVER *serve)
 {
+       CLIENT *client = NULL;
        int sock_flags_old;
        int sock_flags_new;
 
@@ -2372,13 +2373,13 @@ handle_connection(GArray *servers, int net, SERVER 
*serve, CLIENT *client)
            fcntl(net, F_SETFL, sock_flags_new) == -1) {
                err("fcntl F_SETFL ~O_NONBLOCK");
        }
-       if(!client) {
-               client = g_new0(CLIENT, 1);
-               client->server=serve;
-               client->exportsize=OFFT_MAX;
-               client->net=net;
-               client->transactionlogfd = -1;
-       }
+
+       client = g_new0(CLIENT, 1);
+       client->server=serve;
+       client->exportsize=OFFT_MAX;
+       client->net=net;
+       client->transactionlogfd = -1;
+
        if (set_peername(net, client)) {
                goto handle_connection_out;
        }
@@ -2603,7 +2604,7 @@ void serveloop(GArray* servers) {
                                                err_nonfatal("accept: %m");
                                                continue;
                                        }
-                                       handle_connection(servers, net, serve, 
NULL);
+                                       handle_oldstyle_connection(servers, 
net, serve);
                                }
                        }
                }
-- 
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