Skip to content

Commit

Permalink
test/waitid: change the sleep helper to take usecs
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Sep 21, 2023
1 parent 680bae7 commit fcd0a9b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/waitid.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

static bool no_waitid;

static void child(long msleep_time)
static void child(long usleep_time)
{
usleep(msleep_time * 1000UL);
if (usleep_time)
usleep(usleep_time);
exit(0);
}

Expand All @@ -32,7 +33,7 @@ static int test_noexit(struct io_uring *ring)

pid = fork();
if (!pid) {
child(200);
child(200000);
exit(0);
}

Expand Down Expand Up @@ -83,14 +84,14 @@ static int test_double(struct io_uring *ring)
/* p1 will exit shortly */
p1 = fork();
if (!p1) {
child(100);
child(100000);
exit(0);
}

/* p2 will linger */
p2 = fork();
if (!p2) {
child(200);
child(200000);
exit(0);
}

Expand Down Expand Up @@ -171,7 +172,7 @@ static int test_cancel(struct io_uring *ring)

pid = fork();
if (!pid) {
child(1000);
child(20000);
exit(0);
}

Expand Down

0 comments on commit fcd0a9b

Please sign in to comment.