forked from linux-test-project/ltp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend ioctl02 to test termio and termios
Testing the behavior of both sets of ioctl commands at the same time is challenging because they use different structures. This change tries to minimize the amount of code duplication (it is not fully possible) and to minimize the amount of macro code (it is not fully avoidable). To ease this, this change simplifies the checks: * Create a separate function and macro for checking attributes * Remove useless nested condition in loop for checking the control characters * The loop condition is `i < NCC` and the nested condition was `i == VEOL2`. The nested condition is completely useless because it is never reached because `VEOL2 > NCC`. * The same applies to the loop for initializing the structs. * This change introduces use of termios (where `VEOL2 < NCCS`) but extra handling for `VEOL2` can still be avoided. * Implement the check for control characters in terms of the normal attribute check Link: https://lore.kernel.org/ltp/[email protected]/ Reviewed-by: Cyril Hrubis <[email protected]> Reviewed-by: Petr Vorel <[email protected]> Signed-off-by: Marius Kittler <[email protected]> [ pvorel: modify macros to pass and return flag ] Signed-off-by: Petr Vorel <[email protected]>
- Loading branch information
Showing
1 changed file
with
125 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters