[pisa-src] r1312 - trunk/libpisa/tunnel.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 27 Oct 2009 14:02:44 +0100

Author: tjansen
Date: Tue Oct 27 14:02:44 2009
New Revision: 1312

Log:
Fixed warnings:

tunnel.c: In function ‘pisa_tunnel_configure_main’:
tunnel.c:77: warning: ignoring return value of ‘system’, declared with 
attribute warn_unused_result
tunnel.c:82: warning: ignoring return value of ‘system’, declared with 
attribute warn_unused_result
tunnel.c: In function ‘pisa_tunnel_remove_firewall_rules’:
tunnel.c:97: warning: ignoring return value of ‘system’, declared with 
attribute warn_unused_result
tunnel.c:102: warning: ignoring return value of ‘system’, declared with 
attribute warn_unused_result

Modified:
   trunk/libpisa/tunnel.c

Modified: trunk/libpisa/tunnel.c
==============================================================================
--- trunk/libpisa/tunnel.c      Tue Oct 27 13:58:36 2009        (r1311)
+++ trunk/libpisa/tunnel.c      Tue Oct 27 14:02:44 2009        (r1312)
@@ -74,12 +74,14 @@
        snprintf(buffer, sizeof(buffer),
                 "iptables -A INPUT -i %s -p udp --sport 50500 --dport 50500 -j 
DROP",
                 devname);
-       system(buffer);
+       if (system(buffer) < 0)
+               PISA_ERROR("ERROR: %s: cannot configure iptables.\n", 
__FUNCTION__);
 
        snprintf(buffer, sizeof(buffer),
                 "iptables -A OUTPUT -o %s -p udp --sport 50500 --dport 50500 
-j DROP",
                 devname);
-       system(buffer);
+       if (system(buffer) < 0)
+               PISA_ERROR("ERROR: %s: cannot configure iptables.\n", 
__FUNCTION__);
 }
 
 /**
@@ -94,12 +96,14 @@
        snprintf(buffer, sizeof(buffer),
                 "iptables -D INPUT -i %s -p udp --sport 50500 --dport 50500 -j 
DROP",
                 devname);
-       system(buffer);
+       if (system(buffer) < 0)
+               PISA_ERROR("ERROR: %s: cannot configure iptables.\n", 
__FUNCTION__);
 
        snprintf(buffer, sizeof(buffer),
                 "iptables -D OUTPUT -o %s -p udp --sport 50500 --dport 50500 
-j DROP",
                 devname);
-       system(buffer);
+       if (system(buffer) < 0)
+               PISA_ERROR("ERROR: %s: cannot configure iptables.\n", 
__FUNCTION__);
 }
 
 /**

Other related posts:

  • » [pisa-src] r1312 - trunk/libpisa/tunnel.c - Thomas Jansen