From: Victor Stinner Date: Thu, 18 Oct 2007 14:27:03 +0000 (+0000) Subject: Don't silenty exit on failure to open /proc/net/{ip,ip6}_tables_names X-Git-Tag: v1.4.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65334ad262ffe9e7ad82a3b9b42ec4b03cd515e1;p=thirdparty%2Fiptables.git Don't silenty exit on failure to open /proc/net/{ip,ip6}_tables_names Victor Stinner --- 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')