Patchwork [libnftables,2/3] nft-events: add newline to output

login
register
mail settings
Submitter Eric Leblond
Date June 4, 2013, 8:05 a.m.
Message ID <1370333124-11674-3-git-send-email-eric@regit.org>
Download mbox | patch
Permalink /patch/248482/
State Accepted
Headers show

Comments

Eric Leblond - June 4, 2013, 8:05 a.m.
This patch adds a new line to messages to be sure that they are
printed to the shell as soon as they occur. This also fixes the
display of output.

Signed-off-by: Eric Leblond <eric@regit.org>
---
 examples/nft-events.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Pablo Neira - June 5, 2013, 3:52 a.m.
On Tue, Jun 04, 2013 at 10:05:22AM +0200, Eric Leblond wrote:
> This patch adds a new line to messages to be sure that they are
> printed to the shell as soon as they occur. This also fixes the
> display of output.

Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/examples/nft-events.c b/examples/nft-events.c
index aa8c85e..5550c70 100644
--- a/examples/nft-events.c
+++ b/examples/nft-events.c
@@ -39,7 +39,7 @@  static int table_cb(const struct nlmsghdr *nlh, int type)
 	}
 
 	nft_table_snprintf(buf, sizeof(buf), t, NFT_TABLE_O_DEFAULT, 0);
-	printf("[%s]\t%s", type == NFT_MSG_NEWTABLE ? "NEW" : "DEL", buf);
+	printf("[%s]\t%s\n", type == NFT_MSG_NEWTABLE ? "NEW" : "DEL", buf);
 
 err_free:
 	nft_table_free(t);
@@ -64,7 +64,7 @@  static int rule_cb(const struct nlmsghdr *nlh, int type)
 	}
 
 	nft_rule_snprintf(buf, sizeof(buf), t, NFT_RULE_O_DEFAULT, 0);
-	printf("[%s]\t%s", type == NFT_MSG_NEWRULE ? "NEW" : "DEL", buf);
+	printf("[%s]\t%s\n", type == NFT_MSG_NEWRULE ? "NEW" : "DEL", buf);
 
 err_free:
 	nft_rule_free(t);
@@ -89,7 +89,7 @@  static int chain_cb(const struct nlmsghdr *nlh, int type)
 	}
 
 	nft_chain_snprintf(buf, sizeof(buf), t, NFT_CHAIN_O_DEFAULT, 0);
-	printf("[%s]\t%s", type == NFT_MSG_NEWCHAIN ? "NEW" : "DEL", buf);
+	printf("[%s]\t%s\n", type == NFT_MSG_NEWCHAIN ? "NEW" : "DEL", buf);
 
 err_free:
 	nft_chain_free(t);