summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@inl.fr>2007-10-18 14:27:03 +0000
committerPatrick McHardy <kaber@trash.net>2007-10-18 14:27:03 +0000
commit65334ad262ffe9e7ad82a3b9b42ec4b03cd515e1 (patch)
tree0005a7162c1a103335c059756cd53233a841b5b9
parentfceebd8a493a16a767cf1c8e890830c129218c8f (diff)
Don't silenty exit on failure to open /proc/net/{ip,ip6}_tables_names
Victor Stinner <victor.stinner@inl.fr>
-rw-r--r--ip6tables-save.c4
-rw-r--r--iptables-save.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ip6tables-save.c b/ip6tables-save.c
index 479a92b8..d751fb33 100644
--- a/ip6tables-save.c
+++ b/ip6tables-save.c
@@ -231,7 +231,9 @@ static int for_each_table(int (*func)(const char *tablename))
procfile = fopen("/proc/net/ip6_tables_names", "r");
if (!procfile)
- return 0;
+ exit_error(OTHER_PROBLEM,
+ "Unable to open /proc/net/ip6_tables_names: %s\n",
+ strerror(errno));
while (fgets(tablename, sizeof(tablename), procfile)) {
if (tablename[strlen(tablename) - 1] != '\n')
diff --git a/iptables-save.c b/iptables-save.c
index a8a17aac..f020113e 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -242,7 +242,9 @@ static int for_each_table(int (*func)(const char *tablename))
procfile = fopen("/proc/net/ip_tables_names", "r");
if (!procfile)
- return 0;
+ exit_error(OTHER_PROBLEM,
+ "Unable to open /proc/net/ip_tables_names: %s\n",
+ strerror(errno));
while (fgets(tablename, sizeof(tablename), procfile)) {
if (tablename[strlen(tablename) - 1] != '\n')