fcntl: fix lock type interpretation
PATCH 1/1 fcntl: fix lock type interpretation
The lock type switching from an integer to a string in those testcases are wrong because of typo I believe. As part of a batch porting, fcntl17.c did it right.
In /usr/include/asm-generic/fcntl.h:166 defines the posix file lock type value:
Those testcases mistook them as 1, 2, 3 respectively.
This does not affect the test verdict, but is printing wrong message when the type is really not match, for example when testing on CIFS.
Signed-off-by Murphy Zhou <[email protected]>
--- testcases/kernel/syscalls/fcntl/fcntl11.c | 6 +++--- testcases/kernel/syscalls/fcntl/fcntl19.c | 6 +++--- testcases/kernel/syscalls/fcntl/fcntl20.c | 6 +++--- testcases/kernel/syscalls/fcntl/fcntl21.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl11.c +3 -3
@@ -189,11 +189,11 @@ char *str_type(int type)static char buf[20 ];switch (type) { -case 0 : +case F_RDLCK :return ("F_RDLCK" ); -case 1 : +case F_WRLCK :return ("F_WRLCK" ); -case 2 : +case F_UNLCK :return ("F_UNLCK" );default :sprintf (buf,"BAD VALUE: %d" , type);
testcases/kernel/syscalls/fcntl/fcntl19.c +3 -3
@@ -215,11 +215,11 @@ char *str_type(int type)static char buf[20 ];switch (type) { -case 1 : +case F_RDLCK :return ("F_RDLCK" ); -case 2 : +case F_WRLCK :return ("F_WRLCK" ); -case 3 : +case F_UNLCK :return ("F_UNLCK" );default :sprintf (buf,"BAD VALUE: %d" , type);
testcases/kernel/syscalls/fcntl/fcntl20.c +3 -3
@@ -214,11 +214,11 @@ char *str_type(int type)static char buf[20 ];switch (type) { -case 1 : +case F_RDLCK :return ("F_RDLCK" ); -case 2 : +case F_WRLCK :return ("F_WRLCK" ); -case 3 : +case F_UNLCK :return ("F_UNLCK" );default :sprintf (buf,"BAD VALUE: %d" , type);
testcases/kernel/syscalls/fcntl/fcntl21.c +3 -3
@@ -222,11 +222,11 @@ char *str_type(int type)static char buf[20 ];switch (type) { -case 1 : +case F_RDLCK :return ("F_RDLCK" ); -case 2 : +case F_WRLCK :return ("F_WRLCK" ); -case 3 : +case F_UNLCK :return ("F_UNLCK" );default :sprintf (buf,"BAD VALUE: %d" , type);
Signature · 5 lines
2.31.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Thanks for fixing this, pushed.
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp