Skip to content

Commit

Permalink
test/cmd-discard: fixup errno checking
Browse files Browse the repository at this point in the history
Too much liburing, errno is not a negated errno. Use the values
directly.

Fixes: 7ef530b ("test/cmd-discard: skip test on EINVAL/EBUSY open")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Nov 22, 2024
1 parent eb30537 commit e64d789
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/cmd-discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static int basic_cmd_test(struct io_uring *ring, int op)

fd = open(filename, O_DIRECT | O_RDWR | O_EXCL);
if (fd < 0) {
if (errno == -EINVAL || errno == -EBUSY)
if (errno == EINVAL || errno == EBUSY)
return T_EXIT_SKIP;
fprintf(stderr, "open failed %i\n", errno);
return T_EXIT_FAIL;
Expand Down

0 comments on commit e64d789

Please sign in to comment.