Skip to contentSkip to conversation

Change the fd validity check to < 0

PATCH In review 成渭滨 2 participants 2 messages Mar 11 – Mar 12

lore
Share & tools
lore

成渭滨

author
#0 lore raw

PATCH 1/1 Change the fd validity check to < 0

---
 testcases/kernel/controllers/cgroup/cgroup_core02.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/controllers/cgroup/cgroup_core02.c +2 -2
index aba387197..a5c8c9684 100644
@@ -77,8 +77,8 @@ static void test_lesser_ns_open(void)
 		SAFE_MUNMAP(stack, STACK_SIZE);
 
 		for (i = 0; i < targ.loops; i++) {
-			if (targ.fds[i] < 1) {
-				tst_res(TFAIL, "unexpected negative fd %d", targ.fds[i]);
+			if (targ.fds[i] < 0) {
+				tst_res(TFAIL, "unexpected invalid fd %d", targ.fds[i]);
 				exit(1);
 			}
 
Signature · 5 lines
2.20.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi!

Quoted 25 lines
---
 testcases/kernel/controllers/cgroup/cgroup_core02.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/controllers/cgroup/cgroup_core02.c +2 -2
index aba387197..a5c8c9684 100644
@@ -77,8 +77,8 @@ static void test_lesser_ns_open(void)
 		SAFE_MUNMAP(stack, STACK_SIZE);
 
 		for (i = 0; i < targ.loops; i++) {
-			if (targ.fds[i] < 1) {
-				tst_res(TFAIL, "unexpected negative fd %d", targ.fds[i]);
+			if (targ.fds[i] < 0) {
+				tst_res(TFAIL, "unexpected invalid fd %d", targ.fds[i]);
 				exit(1);
 			}
 
Signature · 5 lines
2.20.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

Technically, the message is not matching the logic, but is there a particular case why you think this patch is needed?

Kind regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp