diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-07-07 13:36:17 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-08-18 01:36:12 +0200 |
commit | 2dedd5f419cd9d63fb5b1f76423d096773d3bf6a (patch) | |
tree | 1ceb0a5b7c0d5ef7491ca187b2a3f3dd1050cd1f /src/rule.c | |
parent | a6d10fbc2d23f48190e6920fd03b57c30ebac19a (diff) |
src: get rid of EINTR handling for nft_netlink()
The only remaining caller that needs this is netlink_dump_ruleset(), that is
used to export the ruleset using markup representation. We can remove it and
handle this from do_command_export() now that we have a centralized point to
build up the object cache.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -955,11 +955,13 @@ static int do_command_delete(struct netlink_ctx *ctx, struct cmd *cmd) static int do_command_export(struct netlink_ctx *ctx, struct cmd *cmd) { - struct nft_ruleset *rs = netlink_dump_ruleset(ctx, &cmd->handle, - &cmd->location); + struct nft_ruleset *rs; - if (rs == NULL) - return -1; + do { + rs = netlink_dump_ruleset(ctx, &cmd->handle, &cmd->location); + if (rs == NULL && errno != EINTR) + return -1; + } while (rs == NULL); nft_ruleset_fprintf(stdout, rs, cmd->export->format, 0); fprintf(stdout, "\n"); |