Netdev List
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, Till Maas <opensource@till.name>
Subject: [iproute PATCH 2/4] bridge: Fix check for colored output
Date: Wed, 15 Aug 2018 11:06:08 +0200	[thread overview]
Message-ID: <20180815090610.16646-3-phil@nwl.cc> (raw)
In-Reply-To: <20180815090610.16646-1-phil@nwl.cc>

There is no point in calling enable_color() conditionally if it was
already called for each time '-color' flag was parsed. Align the
algorithm with that in ip and tc by actually making use of 'color'
variable.

Fixes: e9625d6aead11 ("Merge branch 'iproute2-master' into iproute2-next")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 bridge/bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bridge/bridge.c b/bridge/bridge.c
index 7fcfe1116f6e5..289a157d37f03 100644
--- a/bridge/bridge.c
+++ b/bridge/bridge.c
@@ -174,7 +174,7 @@ main(int argc, char **argv)
 			if (netns_switch(argv[1]))
 				exit(-1);
 		} else if (matches(opt, "-color") == 0) {
-			enable_color();
+			++color;
 		} else if (matches(opt, "-compressvlans") == 0) {
 			++compress_vlans;
 		} else if (matches(opt, "-force") == 0) {
-- 
2.18.0

  parent reply	other threads:[~2018-08-15 11:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15  9:06 [iproute PATCH 0/4] A bunch of fixes regarding colored output Phil Sutter
2018-08-15  9:06 ` [iproute PATCH 1/4] tc: Fix typo in check for " Phil Sutter
2018-08-15  9:06 ` Phil Sutter [this message]
2018-08-15  9:06 ` [iproute PATCH 3/4] Merge common code for conditionally " Phil Sutter
2018-08-15  9:06 ` [iproute PATCH 4/4] lib: Enable colored output only for TTYs Phil Sutter
2018-08-15 14:40   ` David Ahern
2018-08-15 15:04     ` Stephen Hemminger
2018-08-15 15:34       ` David Laight
  -- strict thread matches above, loose matches on Subject: below --
2018-08-15 16:21 [iproute PATCH v2 0/4] A bunch of fixes regarding colored output Phil Sutter
2018-08-15 16:21 ` [iproute PATCH 2/4] bridge: Fix check for " Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180815090610.16646-3-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netdev@vger.kernel.org \
    --cc=opensource@till.name \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox