[igt-dev] [PATCH v3 09/12] code_cov_parse_info: fix error handling when opening files

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Thu Apr 14 12:24:59 UTC 2022


From: Mauro Carvalho Chehab <mchehab at kernel.org>

While on bash scripts we use "||" for error handling, perl
accepts it, but it has a higher priority, thus would require
to use parenthesis before that.

That causes it to print a warning when the open fail while
reading filter files, instead of the original intent of
finishing and reporting an error.

So, let's use "or" instead.

Reviewed-by: Ch Sai Gowtham <sai.gowtham.ch at intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---

To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH v3 00/12] at: https://lore.kernel.org/all/cover.1649939026.git.mchehab@kernel.org/

 scripts/code_cov_parse_info | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info
index 3e1525a67d99..c8284a297b33 100755
--- a/scripts/code_cov_parse_info
+++ b/scripts/code_cov_parse_info
@@ -513,7 +513,7 @@ my $filter_str = "";
 my $has_filter;
 
 if ($func_filters) {
-	open IN, $func_filters || die "Can't open $func_filters";
+	open IN, $func_filters or die "Can't open $func_filters";
 	while (<IN>) {
 		s/^\s+//;
 		s/\s+$//;
@@ -524,7 +524,7 @@ if ($func_filters) {
 }
 
 if ($src_filters) {
-	open IN, $src_filters || die "Can't open $src_filters";
+	open IN, $src_filters or die "Can't open $src_filters";
 	while (<IN>) {
 		s/^\s+//;
 		s/\s+$//;
-- 
2.35.1



More information about the igt-dev mailing list