chiark / gitweb /
nntpid: Chiark::NNTP: spot if cat /etc/nntpserver fails
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Nov 2016 11:28:10 +0000 (11:28 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Nov 2016 12:24:30 +0000 (12:24 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
scripts/Chiark/NNTP.pm

index f31652e..4ccfa4a 100644 (file)
@@ -54,7 +54,9 @@ sub cnntp_connect ($) {
 
     my $ns=$ENV{'NNTPSERVER'};
     if (!defined $ns or !length $ns) {
+       $? = 0;
        $ns = `cat /etc/nntpserver`;
+       die if $?;
        chomp($ns);
     }
     my $port = (getservbyname("nntp", "tcp"))[2];