[LTP] [PATCH 2/2] pty04: Fix cleanup

Petr Vorel pvorel@suse.cz
Fri May 20 11:01:33 CEST 2022


Hi Martin, Li, Cyril,

> If pty04 gets executed with -i0 argument, the sk file descriptor will
> stay zero and cleanup() will close stdin, which can result in the parent
> shell logging out. Initialize global file descriptors to -1 and only
> clean up those that were left open by the test.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Thanks a lot. As and obvious fix I'm going to merge it later today.

BTW C API would deserve (after the release) TBROK on -i0, which is already
implemented in shell API:
df01 1 TBROK: Number of iterations (-i) must be > 0

Kind regards,
Petr


More information about the ltp mailing list