]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Print passthrough status to stderr
authorKeith Busch <keith.busch@intel.com>
Thu, 15 Sep 2016 21:19:27 +0000 (15:19 -0600)
committerKeith Busch <keith.busch@intel.com>
Thu, 15 Sep 2016 21:19:27 +0000 (15:19 -0600)
Don't send it to stdout in case the data is being redirected.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 9bd953b946e1d031273d6b2582ab9384dd369fec..a08d613610c8a89d2b6015766e25a1c038f4c90f 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2615,11 +2615,11 @@ static int passthru(int argc, char **argv, int ioctl_cmd, const char *desc, stru
        if (err < 0)
                perror("passthru");
        else if (err)
-               printf("NVMe Status:%s Command Result:%08x\n",
-                               nvme_status_to_string(err), result);
+               fprintf(stderr, "NVMe Status:%s(%x) Command Result:%08x\n",
+                               nvme_status_to_string(err), err, result);
        else  {
                if (!cfg.raw_binary) {
-                       printf("NVMe command result:%08x\n", result);
+                       fprintf(stderr, "NVMe command result:%08x\n", result);
                        if (data && cfg.read && !err)
                                d((unsigned char *)data, cfg.data_len, 16, 1);
                } else if (data && cfg.read)