swrap: Remove redunant check in swrap_socket
authorAnoop C S <anoopcs@redhat.com>
Thu, 11 Aug 2016 14:50:17 +0000 (20:20 +0530)
committerAndreas Schneider <asn@samba.org>
Fri, 12 Aug 2016 06:30:08 +0000 (08:30 +0200)
The very same check is also being made inside swrap_remove_stale().
So we can get rid of this early if condition.

Pair-programmed-with: Michael Adam <obnox@samba.org>
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/socket_wrapper.c

index e944a3b818b49bdf8fa559d0b57a6107e3174f25..b11e4a9c3d6db6543bf94b25f93d08c9994d8242 100644 (file)
@@ -2458,10 +2458,7 @@ static int swrap_socket(int family, int type, int protocol)
        }
 
        /* Check if we have a stale fd and remove it */
-       si = find_socket_info(fd);
-       if (si != NULL) {
-               swrap_remove_stale(fd);
-       }
+       swrap_remove_stale(fd);
 
        si = (struct socket_info *)calloc(1, sizeof(struct socket_info));
        if (si == NULL) {