From: Mark Wooding Date: Sat, 9 Jun 2018 14:53:20 +0000 (+0100) Subject: noip.c (encode_single_inet_addr): Make the logic less weird. X-Git-Tag: 1.2.1~3 X-Git-Url: https://git.distorted.org.uk/~mdw/preload-hacks/commitdiff_plain/c0ae47b31fbdf9729f6ea531d674b93252b1b775?hp=61fbb4a5be3eea4c5e6def5c0d7cc6ef9a5f79ec noip.c (encode_single_inet_addr): Make the logic less weird. Now it doesn't need to know quite so much about all of the possible status values. --- diff --git a/noip.c b/noip.c index 9dfc6c3..fea6f74 100644 --- a/noip.c +++ b/noip.c @@ -734,9 +734,9 @@ static int encode_single_inet_addr(const struct sockaddr *sa, snprintf(sun->sun_path, sizeof(sun->sun_path), "%s/%s", sockdir, present_sockaddr(sa, 0, buf, sizeof(buf))); - if ((rc = unix_socket_status(sun, quickp)) == USED) return (USED); - else if (rc == STALE) unlink(sun->sun_path); - return (UNUSED); + rc = unix_socket_status(sun, quickp); + if (rc == STALE) unlink(sun->sun_path); + return (rc); } /* Convert the IP address SA to a Unix-domain address SUN. Fail if the