]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
NVMe: Fix compile errors
authorMatias Bjørling <m@bjorling.me>
Mon, 9 Feb 2015 09:33:08 +0000 (10:33 +0100)
committerMatias Bjørling <m@bjorling.me>
Mon, 9 Feb 2015 09:36:25 +0000 (10:36 +0100)
A missing = when setting NVME_RW_FUA and the open() function requires
that permission flags are passed when O_CREAT is used in flag.

nvme.c

diff --git a/nvme.c b/nvme.c
index 7415d7ba1de37f5ebeb160680cb97ebc6fb1da65..c0eb43f39449ae6db48aff71b6e85993ec416aef 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1794,13 +1794,13 @@ static int submit_io(int opcode, char *command, int argc, char **argv)
                        io.control |= NVME_RW_LR;
                        break;
                case 'f':
-                       io.control | NVME_RW_FUA;
+                       io.control |= NVME_RW_FUA;
                        break;
                case 'd': 
                        if (opcode & 1)
                          dfd = open(optarg, O_RDONLY);           
                        else
-                         dfd = open(optarg, O_WRONLY | O_CREAT);
+                         dfd = open(optarg, O_WRONLY | O_CREAT, 660);
                        if (dfd < 0) {
                                perror(optarg);
                                return EINVAL;