Oops, getaddrinfo returns an error code (not -1) for error. -Wall is
authorMartin Pool <mbp@samba.org>
Tue, 15 Jan 2002 10:04:11 +0000 (10:04 +0000)
committerMartin Pool <mbp@samba.org>
Tue, 15 Jan 2002 10:04:11 +0000 (10:04 +0000)
good.

socket.c

index 520c3d5..57d895d 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -110,7 +110,7 @@ int try_bind_local(int s,
        bhints.ai_family = ai_family;
        bhints.ai_socktype = ai_socktype;
        bhints.ai_flags = AI_PASSIVE;
-       if (getaddrinfo(bind_address, NULL, &bhints, &bres_all) == -1) {
+       if ((error = getaddrinfo(bind_address, NULL, &bhints, &bres_all))) {
                rprintf(FERROR, RSYNC_NAME ": getaddrinfo %s: %s\n",
                        bind_address, gai_strerror(error));
                return -1;