@@ -58,8 +58,8 @@ static void setup(void)
tst_res(TINFO, "getdtablesize() = %d", max_fds);
pipe_fds = SAFE_MALLOC(max_fds * sizeof(int));
- exp_num_pipes = (max_fds - record_open_fds()) / 2;
- tst_res(TINFO, "expected max fds to be opened by pipe(): %d", exp_num_pipes * 2);
+ exp_num_pipes = (max_fds - record_open_fds()) / 2 * 2;
+ tst_res(TINFO, "expected max fds to be opened by pipe(): %d", exp_num_pipes);
}
static void run(void)
@@ -75,7 +75,7 @@ static void run(void)
} while (!TST_RET);
TST_EXP_EQ_LI(errno, EMFILE);
- TST_EXP_EQ_LI(exp_num_pipes * 2, num_pipe_fds);
+ TST_EXP_EQ_LI(exp_num_pipes, num_pipe_fds);
for (int i = 0; i < num_pipe_fds; i++)
SAFE_CLOSE(pipe_fds[i]);
Move doubling the exp_num_pipes into the value. Signed-off-by: Edward Liaw <edliaw@google.com> --- testcases/kernel/syscalls/pipe/pipe07.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)