vty: Fix typo testing return value of bind
authorSylvain Munaut <tnt@246tNt.com>
Mon, 3 Jan 2011 21:19:40 +0000 (22:19 +0100)
committerSylvain Munaut <tnt@246tNt.com>
Mon, 3 Jan 2011 21:19:40 +0000 (22:19 +0100)
Thanks to playya__ (Dr. Fred) on IRC for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
src/vty/telnet_interface.c

index 1523a89..098fa2e 100644 (file)
@@ -70,7 +70,7 @@ int telnet_init(void *tall_ctx, void *priv, int port)
        sock_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
 
        rc = bind(fd, (struct sockaddr*)&sock_addr, sizeof(sock_addr));
-       if (bind < 0) {
+       if (rc < 0) {
                LOGP(0, LOGL_ERROR, "Telnet interface failed to bind\n");
                close(fd);
                return rc;