[Xcb] [PATCH 1/2] Remove useless gotsockname

Julien Danjou julien at danjou.info
Thu Sep 2 02:29:22 PDT 2010


Signed-off-by: Julien Danjou <julien at danjou.info>
---
 src/xcb_auth.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index 1af27fc..a0fe4e5 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -296,7 +296,6 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
     /* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c,
        xtrans/Xtransutils.c */
     struct sockaddr *sockname = NULL;
-    int gotsockname = 0;
     Xauth *authptr = 0;
     int ret = 1;
 
@@ -313,7 +312,6 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
             free(sockname);
             return 0;   /* except for AF_UNIX, sockets should have peernames */
         }
-        gotsockname = 1;
     }
 
     authptr = get_authptr(sockname, display);
@@ -327,7 +325,7 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
     if (!info->namelen)
         goto no_auth;   /* out of memory */
 
-    if (!gotsockname && (sockname = get_peer_sock_name(getsockname, fd)) == NULL)
+    if (!sockname && (sockname = get_peer_sock_name(getsockname, fd)) == NULL)
     {
         free(info->name);
         goto no_auth;   /* can only authenticate sockets */
-- 
1.7.1



More information about the Xcb mailing list