Skip to content

Commit

Permalink
examples/reg-wait: appease source checker
Browse files Browse the repository at this point in the history
Check the output value of write...

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Nov 2, 2024
1 parent d32b261 commit 6e8946b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/reg-wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ int main(int argc, char *argv[])
struct timeval tv;
int ret, fds[2];

if (argc > 1) {
fprintf(stdout, "%s: takes no arguments\n", argv[0]);
return 0;
}

if (pipe(fds) < 0) {
perror("pipe");
return 1;
Expand Down Expand Up @@ -122,7 +127,11 @@ int main(int argc, char *argv[])
io_uring_prep_read(sqe, fds[0], b2, sizeof(b2), 0);

/* trigger one read */
write(fds[1], "Hello", 5);
ret = write(fds[1], "Hello", 5);
if (ret < 0) {
perror("write");
return 1;
}

/*
* This should will wait for 2 entries, where 1 is already available.
Expand Down

0 comments on commit 6e8946b

Please sign in to comment.