From: Jozsef Kadlecsik Date: Sat, 10 Nov 2018 16:34:57 +0000 (+0100) Subject: Fix to list/save into file specified by option X-Git-Tag: v7.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a680d3fdbb637fae53c60e4a30f028bd5ed1fe4b;p=thirdparty%2Fipset.git Fix to list/save into file specified by option list/save into file given by "-f filename" did not work in 7.0, reported by Isaac Good. --- diff --git a/lib/ipset.c b/lib/ipset.c index 8d05b39e..4366e600 100644 --- a/lib/ipset.c +++ b/lib/ipset.c @@ -633,7 +633,7 @@ restore(struct ipset *ipset) if (ipset->filename) { ret = ipset_session_io_normal(session, ipset->filename, IPSET_IO_INPUT); - if (ret) + if (ret < 0) return ret; f = ipset_session_io_stream(session, IPSET_IO_INPUT); } @@ -1204,9 +1204,10 @@ ipset_parse_argv(struct ipset *ipset, int oargc, char *oargv[]) if (ipset->filename != NULL) { ret = ipset_session_io_normal(session, ipset->filename, IPSET_IO_OUTPUT); - if (!ret) + if (ret < 0) return ret; } + /* Fall through to parse optional setname */ case IPSET_CMD_DESTROY: case IPSET_CMD_FLUSH: /* Args: [setname] */