From 65334ad262ffe9e7ad82a3b9b42ec4b03cd515e1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Oct 2007 14:27:03 +0000 Subject: Don't silenty exit on failure to open /proc/net/{ip,ip6}_tables_names Victor Stinner --- ip6tables-save.c | 4 +++- iptables-save.c | 4 +++- 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') -- cgit v1.2.3