unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 3/3] t/nntpd: die if we can't open stderr output
Date: Tue, 21 Apr 2020 03:22:52 +0000	[thread overview]
Message-ID: <20200421032252.9151-4-e@yhbt.net> (raw)
In-Reply-To: <20200421032252.9151-1-e@yhbt.net>

We need to detect FS errors and bail out on the test
if we can't open a file -nntpd was just writing to.
---
 t/nntpd.t | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/nntpd.t b/t/nntpd.t
index 2d7280a5..5a3a62fb 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -329,12 +329,12 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
 
 	$n = $s = undef;
 	$td->join;
-	my $eout = eval {
-		local $/;
+	is($?, 0, 'no error in exited process');
+	my $eout = do {
 		open my $fh, '<', $err or die "open $err failed: $!";
+		local $/;
 		<$fh>;
 	};
-	is($?, 0, 'no error in exited process');
 	unlike($eout, qr/wide/i, 'no Wide character warnings');
 }
 

      parent reply	other threads:[~2020-04-21  3:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21  3:22 [PATCH 0/3] t/nntpd: small fixes and cleanups Eric Wong
2020-04-21  3:22 ` [PATCH 1/3] t/nntpd: fix lsof check w/ TEST_RUN_MODE=0 Eric Wong
2020-04-21  3:22 ` [PATCH 2/3] t/nntpd: reduce dependencies on internal API Eric Wong
2020-04-21  3:22 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200421032252.9151-4-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).