[nginx] Fixed the first argument to getsockopt().

Ruslan Ermilov ru at nginx.com
Mon Dec 23 11:50:27 UTC 2013


details:   http://hg.nginx.org/nginx/rev/c51b9491b0bd
branches:  
changeset: 5488:c51b9491b0bd
user:      Ruslan Ermilov <ru at nginx.com>
date:      Thu Dec 19 13:43:18 2013 +0400
description:
Fixed the first argument to getsockopt().

While here, always initialize the last argument.

diffstat:

 src/core/ngx_connection.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r a297b7ad6f94 -r c51b9491b0bd src/core/ngx_connection.c
--- a/src/core/ngx_connection.c	Fri Dec 20 16:18:25 2013 +0400
+++ b/src/core/ngx_connection.c	Thu Dec 19 13:43:18 2013 +0400
@@ -199,7 +199,9 @@ ngx_set_inherited_sockets(ngx_cycle_t *c
 
 #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 *c
 
 #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)
         {



More information about the nginx-devel mailing list