mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
selftests/zram: fix kernel_gte() for POSIX sh
Commitfc4eb486a5("selftests/zram: Skip max_comp_streams interface on newer kernel") added kernel_gte() to zram_lib.sh. The function uses the bash-specific [[ ... ]] conditional, but zram selftests source this file while running under /bin/sh. On systems where /bin/sh is dash, such as Debian, the following test fails: dash -c ' kernel_major=6; kernel_minor=1; major=6; minor=0 if [ $kernel_major -gt $major ]; then echo ok elif [[ $kernel_major -eq $major && $kernel_minor -ge $minor ]]; then echo ok fi' with: dash: 5: [[: not found Use separate POSIX test expressions joined by && instead. Fixes:fc4eb486a5("selftests/zram: Skip max_comp_streams interface on newer kernel") Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
20f01a5565
commit
649ba27dfa
|
|
@ -37,7 +37,7 @@ kernel_gte()
|
|||
|
||||
if [ $kernel_major -gt $major ]; then
|
||||
return 0
|
||||
elif [[ $kernel_major -eq $major && $kernel_minor -ge $minor ]]; then
|
||||
elif [ $kernel_major -eq $major ] && [ $kernel_minor -ge $minor ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user