nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: QI Fuli <qi.fuli@jp.fujitsu.com>
To: linux-nvdimm@lists.01.org
Subject: [ndclt PATCH] ndctl, monitor: Fix duplicate prefix in monitor.log
Date: Tue, 31 Jul 2018 14:15:03 +0900	[thread overview]
Message-ID: <20180731051503.30719-1-qi.fuli@jp.fujitsu.com> (raw)

When a monitor runs with [--log] option, the prefix will be dually
added to monitor.log. Therefore, the monitor cannot log the smart
notification to syslog. This patch is used to prevent prefix from
being dually added to monitor.log.

Fixes: fdf6b6844ccf ("ndctl, monitor: add a new command - monitor")
Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com>
---
 ndctl/monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index c6419ad..4e5daf5 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -614,7 +614,8 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
 		goto out;
 
 	if (monitor.log) {
-		fix_filename(prefix, (const char **)&monitor.log);
+		if (strncmp(monitor.log, "./", 2) != 0)
+			fix_filename(prefix, (const char **)&monitor.log);
 		if (strncmp(monitor.log, "./syslog", 8) == 0)
 			ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog);
 		else if (strncmp(monitor.log, "./standard", 10) == 0)
-- 
2.18.0


_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

             reply	other threads:[~2018-07-31  5:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  5:15 QI Fuli [this message]
2018-08-01 18:14 ` [ndclt PATCH] ndctl, monitor: Fix duplicate prefix in monitor.log Masayoshi Mizuma
2018-08-02  9:42   ` Qi, Fuli
2018-08-02 13:22     ` Masayoshi Mizuma
2018-08-02 20:16       ` Verma, Vishal L

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=20180731051503.30719-1-qi.fuli@jp.fujitsu.com \
    --to=qi.fuli@jp.fujitsu.com \
    --cc=linux-nvdimm@lists.01.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;
as well as URLs for NNTP newsgroup(s).