]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-status: return negative status if !errno
authorMinwoo Im <minwoo.im.dev@gmail.com>
Fri, 22 Jan 2021 15:20:38 +0000 (00:20 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 26 Jan 2021 21:21:47 +0000 (14:21 -0700)
commit9d5c6c8f9e087351c44be9c105b2217019c8f624
tree8dfb81758e236d167d7c4aa6759b240774860e43
parent2e563a6cb3ae851a9a0444458cf4ce76cfc4062a
nvme-status: return negative status if !errno

'errno' is set to errno value when system calls are returning with an
error (e.g., ioctl).  But, If a command fails without any system call,
then it needs to return the raw negative error value.

For example, if we don't provide any options for connect command:

root@vm:~# nvme connect
need a transport (-t) argument
root@vm:~# echo $?
0

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
nvme-status.c