From efcb5ec7edba4fc3906d8c9c8f82b6dade7e431b Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 28 Jan 2022 17:58:40 +0100 Subject: [PATCH] util: Set errno in error case nvme_get_directive_receive_length The API says we return -1 in the error case and set the errno accordingly. Update nvme_get_directive_receive_length to fulfill the promise. Signed-off-by: Daniel Wagner --- src/nvme/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvme/util.c b/src/nvme/util.c index b3c76205..50c2021a 100644 --- a/src/nvme/util.c +++ b/src/nvme/util.c @@ -470,10 +470,12 @@ int nvme_get_directive_receive_length(enum nvme_directive_dtype dtype, *len = 0; return 0; default: - return -EINVAL; + errno = EINVAL; + return -1; } default: - return -EINVAL; + errno = EINVAL; + return -1; } } -- 2.50.1