For example: $ cxl monitor -l standard.log User is most likely want to save log to ./standard.log instead of stdout.
Signed-off-by: Li Zhijian <[email protected]> --- cxl/monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cxl/monitor.c b/cxl/monitor.c index 4043928db3ef..842e54b186ab 100644 --- a/cxl/monitor.c +++ b/cxl/monitor.c @@ -181,7 +181,8 @@ int cmd_monitor(int argc, const char **argv, struct cxl_ctx *ctx) if (monitor.log) { if (strncmp(monitor.log, "./", 2) != 0) fix_filename(prefix, (const char **)&monitor.log); - if (strncmp(monitor.log, "./standard", 10) == 0 && !monitor.daemon) { + + if (strcmp(monitor.log, "./standard") == 0 && !monitor.daemon) { monitor.ctx.log_fn = log_standard; } else { const char *log = monitor.log; -- 2.29.2
