--- loncom/lonnet/perl/lonnet.pm 2019/02/15 21:34:43 1.1172.2.104 +++ loncom/lonnet/perl/lonnet.pm 2019/02/18 15:19:30 1.1172.2.105 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1172.2.104 2019/02/15 21:34:43 raeburn Exp $ +# $Id: lonnet.pm,v 1.1172.2.105 2019/02/18 15:19:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -12802,12 +12802,12 @@ sub get_dns { &$func(\@content,$hashref); return; } - close($config); my $which = (split('/',$url))[3]; &logthis("unable to contact DNS defaulting to on disk file dns_$which.tab\n"); - open($config,"<","$perlvar{'lonTabDir'}/dns_$which.tab"); - my @content = <$config>; - &$func(\@content,$hashref); + if (open(my $config,"<","$perlvar{'lonTabDir'}/dns_$which.tab")) { + my @content = <$config>; + &$func(\@content,$hashref); + } return; }