[LTP] [PATCH 1/1] network/echoes: fix endless loop on error

Alexey Kodanev alexey.kodanev@oracle.com
Thu Dec 15 12:48:46 CET 2016


Hi Petr,
On 14.12.2016 20:06, Petr Vorel wrote:
> Hi Alexey,
>
>> Good catch, looks like we could substitute the while loop here with
>> tst_reap_children() library function and remove "echo_struc" as well?
> Could you please push this quick fix? I plan to rewrite test into new API, but probably
> will not manage it until the release.

OK,  but if we want a quick fix here we can just add a single "break" 
after the loop where
it is killing all the left child processes. No need to proceed anyway. 
If you agree I'll push
the patch with the break version:

--- a/testcases/network/tcp_cmds/echo/echoes.c
+++ b/testcases/network/tcp_cmds/echo/echoes.c
@@ -121,7 +121,7 @@ int main(int argc, char *argv[], char *env[])
                                         kill(echo_struc[k].pid, 9);
                                 }
                         }
-
+                       break;
                 }

         }

Thanks,
Alexey


More information about the ltp mailing list