From: Edward Liaw via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: kernel-team@android.com
Subject: [LTP] [PATCH v2 2/2] pipe07: refactor exp_num_pipes
Date: Mon, 2 Oct 2023 17:34:16 +0000 [thread overview]
Message-ID: <20231002173416.1080347-3-edliaw@google.com> (raw)
In-Reply-To: <20231002173416.1080347-1-edliaw@google.com>
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(-)
diff --git a/testcases/kernel/syscalls/pipe/pipe07.c b/testcases/kernel/syscalls/pipe/pipe07.c
index d9b23044d..8098007c2 100644
--- a/testcases/kernel/syscalls/pipe/pipe07.c
+++ b/testcases/kernel/syscalls/pipe/pipe07.c
@@ -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]);
--
2.42.0.582.g8ccd20d70d-goog
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-10-02 17:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 17:34 [LTP] [PATCH v2 0/2] pipe07: close /proc/self/fd after counting fds Edward Liaw via ltp
2023-10-02 17:34 ` [LTP] [PATCH v2 1/2] " Edward Liaw via ltp
2023-10-02 17:34 ` Edward Liaw via ltp [this message]
2023-10-26 10:03 ` [LTP] [PATCH v2 2/2] pipe07: refactor exp_num_pipes Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231002173416.1080347-3-edliaw@google.com \
--to=ltp@lists.linux.it \
--cc=edliaw@google.com \
--cc=kernel-team@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox