diff mbox series

[2/2] kselftest: Support old perl versions

Message ID 20191202114221.827-2-sjpark@amazon.com (mailing list archive)
State Mainlined
Commit 4eac734486fd431e0756cc5e929f140911a36a53
Headers show
Series [1/2] kselftest/runner: Print new line in print of timeout log | expand

Commit Message

SeongJae Park Dec. 2, 2019, 11:42 a.m. UTC
From: SeongJae Park <sjpark@amazon.de>

On an old perl such as v5.10.1, `kselftest/prefix.pl` gives below error
message:

    Can't locate object method "autoflush" via package "IO::Handle" at kselftest/prefix.pl line 10.

This commit fixes the error by explicitly specifying the use of the
`IO::Handle` package.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/testing/selftests/kselftest/prefix.pl | 1 +
 1 file changed, 1 insertion(+)

Comments

Kees Cook Dec. 7, 2019, 6:47 p.m. UTC | #1
On Mon, Dec 02, 2019 at 12:42:21PM +0100, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> On an old perl such as v5.10.1, `kselftest/prefix.pl` gives below error
> message:
> 
>     Can't locate object method "autoflush" via package "IO::Handle" at kselftest/prefix.pl line 10.
> 
> This commit fixes the error by explicitly specifying the use of the
> `IO::Handle` package.
> 
> Signed-off-by: SeongJae Park <sjpark@amazon.de>

Good catch!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  tools/testing/selftests/kselftest/prefix.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl
> index ec7e48118183..31f7c2a0a8bd 100755
> --- a/tools/testing/selftests/kselftest/prefix.pl
> +++ b/tools/testing/selftests/kselftest/prefix.pl
> @@ -3,6 +3,7 @@
>  # Prefix all lines with "# ", unbuffered. Command being piped in may need
>  # to have unbuffering forced with "stdbuf -i0 -o0 -e0 $cmd".
>  use strict;
> +use IO::Handle;
>  
>  binmode STDIN;
>  binmode STDOUT;
> -- 
> 2.17.1
>
shuah Dec. 11, 2019, 5:20 p.m. UTC | #2
On 12/7/19 11:47 AM, Kees Cook wrote:
> On Mon, Dec 02, 2019 at 12:42:21PM +0100, SeongJae Park wrote:
>> From: SeongJae Park <sjpark@amazon.de>
>>
>> On an old perl such as v5.10.1, `kselftest/prefix.pl` gives below error
>> message:
>>
>>      Can't locate object method "autoflush" via package "IO::Handle" at kselftest/prefix.pl line 10.
>>
>> This commit fixes the error by explicitly specifying the use of the
>> `IO::Handle` package.
>>
>> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> 
> Good catch!
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> 
> -Kees
> 
>> ---
>>   tools/testing/selftests/kselftest/prefix.pl | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl
>> index ec7e48118183..31f7c2a0a8bd 100755
>> --- a/tools/testing/selftests/kselftest/prefix.pl
>> +++ b/tools/testing/selftests/kselftest/prefix.pl
>> @@ -3,6 +3,7 @@
>>   # Prefix all lines with "# ", unbuffered. Command being piped in may need
>>   # to have unbuffering forced with "stdbuf -i0 -o0 -e0 $cmd".
>>   use strict;
>> +use IO::Handle;
>>   
>>   binmode STDIN;
>>   binmode STDOUT;
>> -- 
>> 2.17.1
>>
> 

Applying to fixes for next 5.5-rc

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/kselftest/prefix.pl b/tools/testing/selftests/kselftest/prefix.pl
index ec7e48118183..31f7c2a0a8bd 100755
--- a/tools/testing/selftests/kselftest/prefix.pl
+++ b/tools/testing/selftests/kselftest/prefix.pl
@@ -3,6 +3,7 @@ 
 # Prefix all lines with "# ", unbuffered. Command being piped in may need
 # to have unbuffering forced with "stdbuf -i0 -o0 -e0 $cmd".
 use strict;
+use IO::Handle;
 
 binmode STDIN;
 binmode STDOUT;