From: Chaitanya Kulkarni Date: Mon, 26 Jun 2017 20:59:08 +0000 (-0700) Subject: nvme-cli: add error message for nvme list. X-Git-Tag: v1.4~38^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c1ac9ffa1b56ced41f71b83b07174e78bfc25c64;p=users%2Fsagi%2Fnvme-cli.git nvme-cli: add error message for nvme list. Print error message for "nvme list" command when NVMe device(s) is not present. --- diff --git a/nvme.c b/nvme.c index f746b744..6a544984 100644 --- a/nvme.c +++ b/nvme.c @@ -836,8 +836,10 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi return -EINVAL; n = scandir(dev, &devices, scan_dev_filter, alphasort); - if (n < 0) + if (n < 0) { + fprintf(stderr, "no NVMe device(s) detected.\n"); return n; + } list_items = calloc(n, sizeof(*list_items)); if (!list_items) {