]> git.gsnw.org Git - fping.git/commitdiff
Fix build with --disable-ipv6
authorLars Wendler <polynomial-c@gentoo.org>
Tue, 18 Sep 2018 13:05:36 +0000 (15:05 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Tue, 18 Sep 2018 13:10:04 +0000 (15:10 +0200)
Otheriwse build breaks with:

fping.c:690:24: error: ‘socket6’ undeclared (first use in this function);
did you mean ‘socket4’?

src/fping.c

index 35edca43fe333e70f76279491a35c6f202c466e6..414da2fdf04a92f3e53b7332a5117f278af34f19 100644 (file)
@@ -687,7 +687,11 @@ int main(int argc, char** argv)
 
     /* validate various option settings */
 
-    if (socket4 < 0 && socket6 < 0) {
+    if (socket4 < 0
+#ifdef IPV6
+       && socket6 < 0
+#endif
+    ) {
         crash_and_burn("can't create socket (must run as root?)");
     }