]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
libnftables: Fix forgotten bit after introducing error_fp
authorPhil Sutter <phil@nwl.cc>
Fri, 13 Apr 2018 14:52:25 +0000 (16:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 14 Apr 2018 11:53:02 +0000 (13:53 +0200)
Like nft_run_cmd_from_buffer, nft_run_cmd_from_filename doesn't need to
change output_fp temporarily when printing error records anymore.

Fixes: 4176e24e14f07 ("libnftables: Introduce nft_ctx_set_error()")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/libnftables.c

index 44e06e1a50835d6e3ffcd006427bdc88991fbbbb..cd356250df86994b411db3f139c415545c6962f9 100644 (file)
@@ -433,7 +433,6 @@ int nft_run_cmd_from_filename(struct nft_ctx *nft, const char *filename)
        LIST_HEAD(msgs);
        void *scanner;
        int rc;
-       FILE *fp;
 
        rc = cache_update(nft->nf_sock, &nft->cache, CMD_INVALID, &msgs,
                          nft->debug_mask, &nft->output);
@@ -454,9 +453,7 @@ int nft_run_cmd_from_filename(struct nft_ctx *nft, const char *filename)
        if (nft_run(nft, nft->nf_sock, scanner, &state, &msgs) != 0)
                rc = -1;
 err:
-       fp = nft_ctx_set_output(nft, stderr);
        erec_print_list(&nft->output, &msgs, nft->debug_mask);
-       nft_ctx_set_output(nft, fp);
        scanner_destroy(scanner);
        iface_cache_release();