The pipe write does not include the string terminator. The way the
test is written it's valid for the writer to send less than the
requested data and for the reader to read less than the number of
written bytes, so just compare the actual bytes received.

Signed-off-by: Chris Dearman <[email protected]>
---
 testcases/kernel/syscalls/pipe/pipe01.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/pipe/pipe01.c 
b/testcases/kernel/syscalls/pipe/pipe01.c
index 08cf612..f49d7f4 100644
--- a/testcases/kernel/syscalls/pipe/pipe01.c
+++ b/testcases/kernel/syscalls/pipe/pipe01.c
@@ -119,7 +119,7 @@ int main(int ac, char **av)
                        }
 
                        /* are the strings written and read equal */
-                       if ((greater = strcmp(rebuf, wrbuf)) != 0) {
+                       if ((greater = strncmp(rebuf, wrbuf, red)) != 0) {
                                tst_resm(TFAIL, "Condition #3 test failed");
                                continue;
                        }
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to