summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/rule.c b/src/rule.c
index eb91be46..37d99c22 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1153,9 +1153,6 @@ static int do_command_export(struct netlink_ctx *ctx, struct cmd *cmd)
struct nftnl_ruleset *rs;
FILE *fp = ctx->octx->output_fp;
- if (!fp)
- return 0;
-
do {
rs = netlink_dump_ruleset(ctx, &cmd->handle, &cmd->location);
if (rs == NULL && errno != EINTR)
@@ -1163,8 +1160,7 @@ static int do_command_export(struct netlink_ctx *ctx, struct cmd *cmd)
} while (rs == NULL);
nftnl_ruleset_fprintf(fp, rs, cmd->export->format, 0);
- fprintf(fp, "\n");
- fflush(fp);
+ nft_print(ctx->octx, "\n");
nftnl_ruleset_free(rs);
return 0;