]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
cleanup: set variable only if it is used
authorSami Kerola <kerolasa@iki.fi>
Sun, 4 Sep 2016 16:20:55 +0000 (17:20 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sun, 4 Sep 2016 20:13:40 +0000 (21:13 +0100)
Variable introduction needs to be same way preprocessor conditional as the
related code.  This is a minor clean up, because modern compilers should
remove these types of variables automatically.

net.c

diff --git a/net.c b/net.c
index 1cd97a3f6b43231df729c3feacd0c22821abf0d1..047d953594a56e714c65f6e27e4f093ae9bf4c2b 100644 (file)
--- a/net.c
+++ b/net.c
@@ -1341,7 +1341,9 @@ static void set_fd_flags(int fd)
 
 extern int net_preopen(void) 
 {
+#ifdef IP_HDRINCL
   int trueopt = 1;
+#endif
 
 #if !defined(IP_HDRINCL) && defined(IP_TOS) && defined(IP_TTL)
   sendsock4_icmp = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);