2019-12-02 11:45:15

by SeongJae Park

[permalink] [raw]
Subject: [PATCH 2/2] kselftest: Support old perl versions

From: SeongJae Park <[email protected]>

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 <[email protected]>
---
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


2019-12-07 18:48:57

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH 2/2] kselftest: Support old perl versions

On Mon, Dec 02, 2019 at 12:42:21PM +0100, SeongJae Park wrote:
> From: SeongJae Park <[email protected]>
>
> 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 <[email protected]>

Good catch!

Acked-by: Kees Cook <[email protected]>

-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
>

--
Kees Cook

2019-12-11 17:21:41

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 2/2] kselftest: Support old perl versions

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 <[email protected]>
>>
>> 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 <[email protected]>
>
> Good catch!
>
> Acked-by: Kees Cook <[email protected]>
>
> -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