Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
if (errno != EEXIST)
perror("mnl-talk:nft_commit");
}
- return ret;
+ return ret == 0 ? 1 : 0;
}
int nft_commit(struct nft_handle *h)
* global commit at once, stick by now to
* the existing behaviour.
*/
- if (nft_commit(&h)) {
- fprintf(stderr, "Failed to commit "
- "table %s\n",
- curtable);
- }
DEBUGP("Calling commit\n");
- ret = 1;
+ ret = nft_commit(&h);
} else {
- if (nft_abort(&h)) {
- xtables_error(OTHER_PROBLEM,
- "Failed to abort "
- "commit in table %s\n",
- curtable);
- }
DEBUGP("Not calling commit, testing\n");
- ret = 1;
+ ret = nft_abort(&h);
}
in_table = 0;