]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli/list: change fd returned by open operation from unsigned to signed.
authorXiao Liang <xiliang@redhat.com>
Tue, 8 Aug 2017 15:55:23 +0000 (23:55 +0800)
committerXiao Liang <xiliang@redhat.com>
Tue, 8 Aug 2017 15:57:36 +0000 (23:57 +0800)
In case it is a negative value when user has no permisson to open file.

Signed-off-by: Xiao Liang <xiliang@redhat.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index b4a039ada597882cf7f9ac1b3362c1bbfa6175eb..0a65d7f2db696d0f4e7b0d1b7b30920fe9c67ac2 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -871,8 +871,8 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi
        char path[264];
        struct dirent **devices;
        struct list_item *list_items;
-       unsigned int i, n, fd;
-       int fmt, ret;
+       unsigned int i, n;
+       int fmt, ret, fd;
        const char *desc = "Retrieve basic information for the given device";
        struct config {
                char *output_format;