]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: Revert passthru and submit_io to print status to stderr from stdout
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 6 Aug 2023 13:57:44 +0000 (22:57 +0900)
committerDaniel Wagner <wagi@monom.org>
Tue, 8 Aug 2023 07:38:54 +0000 (09:38 +0200)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 432d6554ce1b697618b3d2b798f4c26059e9c311..fabadaaa0e5bee976377ca6a9447695de4f84213 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -7690,7 +7690,7 @@ static int submit_io(int opcode, char *command, const char *desc, int argc, char
                            strerror(errno));
                        err = -EINVAL;
                } else {
-                       printf("%s: Success\n", command);
+                       fprintf(stderr, "%s: Success\n", command);
                }
        }
 
@@ -8622,8 +8622,8 @@ static int passthru(int argc, char **argv, bool admin,
        } else if (err) {
                nvme_show_status(err);
        } else  {
-               printf("%s Command %s is Success and result: 0x%08x\n", admin ? "Admin" : "IO",
-                      strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific", result);
+               fprintf(stderr, "%s Command %s is Success and result: 0x%08x\n", admin ? "Admin" : "IO",
+                       strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific", result);
                if (cfg.read)
                        passthru_print_read_output(cfg, data, dfd, mdata, mfd, err);
        }