Skip to content

Commit efcb5ec

Browse files
committed
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 <[email protected]>
1 parent 12a90e5 commit efcb5ec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/nvme/util.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,12 @@ int nvme_get_directive_receive_length(enum nvme_directive_dtype dtype,
470470
*len = 0;
471471
return 0;
472472
default:
473-
return -EINVAL;
473+
errno = EINVAL;
474+
return -1;
474475
}
475476
default:
476-
return -EINVAL;
477+
errno = EINVAL;
478+
return -1;
477479
}
478480
}
479481

0 commit comments

Comments
 (0)