Skip to content

Commit

Permalink
Make big_select test not depend on how stdin has been redirected
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Sep 26, 2023
1 parent 9d62e13 commit cd2b2c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/big_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ int main(void) {
long longs[NUM_LONGS];
} *fdset;
int ret;
int pipe_fds[2];
struct timeval timeout = { 0, 0 };
struct rlimit rlim = { FD_SETSIZE + 1, FD_SETSIZE + 1 };
if (setrlimit(RLIMIT_NOFILE, &rlim)) {
Expand All @@ -17,7 +18,9 @@ int main(void) {
return 0;
}

ret = dup2(0, FD_SETSIZE);
ret = pipe(pipe_fds);
test_assert(ret == 0);
ret = dup2(pipe_fds[0], FD_SETSIZE);
test_assert(ret == FD_SETSIZE);

ALLOCATE_GUARD(fdset, 'a');
Expand Down

0 comments on commit cd2b2c6

Please sign in to comment.