* [LTP] [PATCH] pipe01 should only check the data actually received from the pipe
@ 2012-10-16 14:18 Chris Dearman
2012-10-17 17:38 ` Chris Dearman
0 siblings, 1 reply; 3+ messages in thread
From: Chris Dearman @ 2012-10-16 14:18 UTC (permalink / raw)
To: ltp-list; +Cc: Chris Dearman
The pipe write does not include the string terminator and the way the
test is written it's valid for the writer to send less than the
requested amount 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 <chris@mips.com>
---
testcases/kernel/syscalls/pipe/pipe01.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/pipe/pipe01.c
b/testcases/kernel/syscalls/pipe/pipe01.c
index 08cf612..04d1b11 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;
}
@@ -155,4 +155,4 @@ void cleanup()
* print errno log if that option was specified.
*/
TEST_CLEANUP;
-}
\ No newline at end of file
+}
--
1.7.1
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH] pipe01 should only check the data actually received from the pipe
2012-10-16 14:18 [LTP] [PATCH] pipe01 should only check the data actually received from the pipe Chris Dearman
@ 2012-10-17 17:38 ` Chris Dearman
2012-10-18 1:36 ` Wanlong Gao
0 siblings, 1 reply; 3+ messages in thread
From: Chris Dearman @ 2012-10-17 17:38 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 404 bytes --]
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 <chris@mips.com>
---
testcases/kernel/syscalls/pipe/pipe01.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[-- Attachment #2: improve-correctness-of-pipe01.patch --]
[-- Type: text/plain, Size: 497 bytes --]
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;
}
[-- Attachment #3: Type: text/plain, Size: 240 bytes --]
------------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] pipe01 should only check the data actually received from the pipe
2012-10-17 17:38 ` Chris Dearman
@ 2012-10-18 1:36 ` Wanlong Gao
0 siblings, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2012-10-18 1:36 UTC (permalink / raw)
To: Chris Dearman; +Cc: ltp-list
On 10/18/2012 01:38 AM, Chris Dearman wrote:
> 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 <chris@mips.com>
Pushed with Cyril's Ack, thank you.
Wanlong Gao
> ---
> testcases/kernel/syscalls/pipe/pipe01.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
>
> ------------------------------------------------------------------------------
> 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
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-18 1:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-16 14:18 [LTP] [PATCH] pipe01 should only check the data actually received from the pipe Chris Dearman
2012-10-17 17:38 ` Chris Dearman
2012-10-18 1:36 ` Wanlong Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox