From patchwork Tue Jun 4 08:05:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 248482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BC5272C0099 for ; Tue, 4 Jun 2013 18:05:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750926Ab3FDIFu (ORCPT ); Tue, 4 Jun 2013 04:05:50 -0400 Received: from ks28632.kimsufi.com ([91.121.96.152]:50701 "EHLO ks28632.kimsufi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818Ab3FDIFn (ORCPT ); Tue, 4 Jun 2013 04:05:43 -0400 Received: from bayen.regit.org ([81.57.69.189] helo=ice-age.regit.org) by ks28632.kimsufi.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UjmFR-0007ry-Uj; Tue, 04 Jun 2013 10:05:42 +0200 From: Eric Leblond To: netfilter-devel@vger.kernel.org Cc: Eric Leblond Subject: [libnftables PATCH 2/3] nft-events: add newline to output Date: Tue, 4 Jun 2013 10:05:22 +0200 Message-Id: <1370333124-11674-3-git-send-email-eric@regit.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370333124-11674-1-git-send-email-eric@regit.org> References: <1370333124-11674-1-git-send-email-eric@regit.org> X-Spam-Score: -2.9 (--) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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 --- examples/nft-events.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);