]> git.kaiwu.me - nginx.git/commitdiff
Fixed the first argument to getsockopt().
authorRuslan Ermilov <ru@nginx.com>
Thu, 19 Dec 2013 09:43:18 +0000 (13:43 +0400)
committerRuslan Ermilov <ru@nginx.com>
Thu, 19 Dec 2013 09:43:18 +0000 (13:43 +0400)
While here, always initialize the last argument.

src/core/ngx_connection.c

index 57e26912da14e1044e79cc8a3e49c153dfebcaa2..08a547d42df9ff56611ba57890a4b215dcb6b32d 100644 (file)
@@ -199,7 +199,9 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
 
 #if (NGX_HAVE_SETFIB)
 
-        if (getsockopt(ls[i].setfib, SOL_SOCKET, SO_SETFIB,
+        olen = sizeof(int);
+
+        if (getsockopt(ls[i].fd, SOL_SOCKET, SO_SETFIB,
                        (void *) &ls[i].setfib, &olen)
             == -1)
         {
@@ -215,7 +217,9 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
 
 #if (NGX_HAVE_TCP_FASTOPEN)
 
-        if (getsockopt(ls[i].fastopen, IPPROTO_TCP, TCP_FASTOPEN,
+        olen = sizeof(int);
+
+        if (getsockopt(ls[i].fd, IPPROTO_TCP, TCP_FASTOPEN,
                        (void *) &ls[i].fastopen, &olen)
             == -1)
         {