]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Don't silenty exit on failure to open /proc/net/{ip,ip6}_tables_names
authorVictor Stinner <victor.stinner@inl.fr>
Thu, 18 Oct 2007 14:27:03 +0000 (14:27 +0000)
committerPatrick McHardy <kaber@trash.net>
Thu, 18 Oct 2007 14:27:03 +0000 (14:27 +0000)
Victor Stinner <victor.stinner@inl.fr>

ip6tables-save.c
iptables-save.c

index 479a92b89c2a32d3b60f222fa370af0a376ae293..d751fb33c6d8ab7e5e6f4a5a16f960f749ca7195 100644 (file)
@@ -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')
index a8a17aac75075aa88dfdfb6efcbf92e60a70d4a9..f020113e1be17372eba032f20b98ad216f446fb0 100644 (file)
@@ -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')