Empirically, if glob cannot do its work, it sets $! and returns an empty list.
Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com> --- Osstest/Serial/sympathy.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Osstest/Serial/sympathy.pm b/Osstest/Serial/sympathy.pm index 84a1e09..7461e07 100644 --- a/Osstest/Serial/sympathy.pm +++ b/Osstest/Serial/sympathy.pm @@ -112,7 +112,10 @@ sub fetch_logs { my %done; for (;;) { my $anydone= 0; - foreach my $logfile (glob $logpat) { + $!=0; + my @logfiles = glob $logpat; + die "$logpat (@logfiles) $!" if $!; + foreach my $logfile (@logfiles) { my $lh= new IO::File $logfile, 'r'; if (!defined $lh) { $!==&ENOENT or warn "$logfile $!"; -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel