From 4023bdadbdd44f12d7e427047d3bbb8b082fe55e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 14 Sep 2020 18:00:55 +0000 Subject: [PATCH] scstadmin: Fix a Perl warning git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9159 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm index 9f69ba3f4..ef638ca32 100644 --- a/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm +++ b/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm @@ -494,7 +494,11 @@ sub setScstAttribute { return TRUE if (!length($attribute) || !defined($value)); - my $bytes = -ENOENT; + # There is a space between the unary minus sign and ENOENT because + # without that space older Perl versions report the following warning: + # Ambiguous use of -ENOENT resolved as -&ENOENT() at + # /usr/share/perl5/vendor_perl/SCST/SCST.pm line 497. + my $bytes = - ENOENT; my $path = make_path(SCST_ROOT_DIR(), $attribute); my $io = new IO::File $path, O_WRONLY; if ($io) {