summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-09-29 13:26:22 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-09-29 13:27:46 +0200
commit28180991740e6942adfb12650ff2472d73e89387 (patch)
tree297fd752e6558f8a042ab5ba0ec460cf6f051f6d /src
parentbf89889eda80d6c67a19cbd358683bc704be7a2d (diff)
main: Drop stdout hack to expose nft_print() implementation issues
This was helpful when testing nft_print() implementation, but breaks 'nft --help' output. Also, with this in place typical printf-debugging would have to use stderr at all times which is confusing at least. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 6d2422ff..fc79cfaa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -415,11 +415,9 @@ int main(int argc, char * const *argv)
bool interactive = false;
struct parser_state state;
int i, val, rc;
- FILE *outfp = fdopen(dup(STDOUT_FILENO), "w");
nft = nft_ctx_new(NFT_CTX_DEFAULT);
- nft_ctx_set_output(nft, outfp);
- close(STDOUT_FILENO);
+ nft_ctx_set_output(nft, stdout);
while (1) {
val = getopt_long(argc, argv, OPTSTRING, options, NULL);