It's better to keep variables strictly inside their usage scope than in more wider scope to avoid unintentional variable shadowing and leaking.
Signed-off-by: Tuomas Räsänen <[email protected]> --- nbd-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd-server.c b/nbd-server.c index f3c78bd..392ed9f 100644 --- a/nbd-server.c +++ b/nbd-server.c @@ -2365,7 +2365,6 @@ void serveloop(GArray* servers) { socklen_t addrinlen=sizeof(addrin); int i; int max; - int sock; fd_set mset; fd_set rset; @@ -2379,6 +2378,7 @@ void serveloop(GArray* servers) { max=0; FD_ZERO(&mset); for(i=0;i<servers->len;i++) { + int sock; if((sock=(g_array_index(servers, SERVER, i)).socket) >= 0) { FD_SET(sock, &mset); max=sock>max?sock:max; -- 1.7.10.4 ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 _______________________________________________ Nbd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nbd-general
