Fixes following issue reported by clang-12 static analyzer:
mdnsd/interface.c:360:3: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
mdnsd/interface.c:394:3: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
Original author most likely wanted to assing -1 to the original
interface filedescriptor.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
fprintf(stderr, "failed to join multicast group: %m\n");
close(fd);
- fd = -1;
+ iface->fd.fd = -1;
return -1;
}
if (setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
fprintf(stderr, "failed to join multicast group: %m\n");
close(fd);
- fd = -1;
+ iface->fd.fd = -1;
return -1;
}