* [LTP] [PATCH] pty04: Fix read retries
@ 2020-05-14 13:32 Richard Palethorpe
2020-05-14 13:39 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Richard Palethorpe @ 2020-05-14 13:32 UTC (permalink / raw)
To: ltp
We need to increase the data pointer by the amount already read.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
testcases/kernel/pty/pty04.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/pty/pty04.c b/testcases/kernel/pty/pty04.c
index 68a84ea87..d574d8b2c 100644
--- a/testcases/kernel/pty/pty04.c
+++ b/testcases/kernel/pty/pty04.c
@@ -294,7 +294,7 @@ static void try_read(int fd, char *data, ssize_t size)
int retry = mtu;
while (retry--) {
- ret = read(fd, data, size - n);
+ ret = read(fd, data + n, size - n);
if (ret < 0)
break;
--
2.26.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] pty04: Fix read retries
2020-05-14 13:32 [LTP] [PATCH] pty04: Fix read retries Richard Palethorpe
@ 2020-05-14 13:39 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2020-05-14 13:39 UTC (permalink / raw)
To: ltp
Hi!
> We need to increase the data pointer by the amount already read.
Applied, thanks.
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
> testcases/kernel/pty/pty04.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/pty/pty04.c b/testcases/kernel/pty/pty04.c
> index 68a84ea87..d574d8b2c 100644
> --- a/testcases/kernel/pty/pty04.c
> +++ b/testcases/kernel/pty/pty04.c
> @@ -294,7 +294,7 @@ static void try_read(int fd, char *data, ssize_t size)
> int retry = mtu;
>
> while (retry--) {
> - ret = read(fd, data, size - n);
> + ret = read(fd, data + n, size - n);
Sorry for not catching that during the review...
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-14 13:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-14 13:32 [LTP] [PATCH] pty04: Fix read retries Richard Palethorpe
2020-05-14 13:39 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox