diff options
author | Eric Wong <e@80x24.org> | 2021-03-04 17:03:15 +0800 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-04 14:29:42 -0400 |
commit | be5975337332d8ac681f4c2101e2ca436550c90b (patch) | |
tree | ee640637cc5ab48fce029863406dfd3cdf9faf2e | |
parent | 6c551bffd75afb41d9b5e4774068abe7e06ed0e7 (diff) | |
download | public-inbox-be5975337332d8ac681f4c2101e2ca436550c90b.tar.gz |
We're not forking, here, so there's no need to rely on FD_CLOEXEC to resolve deadlock issues.
-rw-r--r-- | t/lei_to_mail.t | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/t/lei_to_mail.t b/t/lei_to_mail.t index 7898cc48..585db689 100644 --- a/t/lei_to_mail.t +++ b/t/lei_to_mail.t @@ -6,8 +6,8 @@ use v5.10.1; use Test::More; use PublicInbox::TestCommon; use PublicInbox::Eml; -use Fcntl qw(SEEK_SET); -use PublicInbox::Spawn qw(popen_rd which); +use Fcntl qw(SEEK_SET O_RDONLY O_NONBLOCK); +use PublicInbox::Spawn qw(popen_rd); use List::Util qw(shuffle); require_mods(qw(DBD::SQLite)); require PublicInbox::MdirReader; @@ -242,11 +242,12 @@ SKIP: { # FIFO support use POSIX qw(mkfifo); my $fn = "$tmpdir/fifo"; mkfifo($fn, 0600) or skip("mkfifo not supported: $!", 1); - my $cat = popen_rd([which('cat'), $fn]); + sysopen(my $cat, $fn, O_RDONLY|O_NONBLOCK) or BAIL_OUT $!; my $wcb = $wcb_get->('mboxo', $fn); $wcb->(\(my $x = $buf), $deadbeef); $commit->($wcb); my $cmp = ''; + $cat->blocking(1); PublicInbox::MboxReader->mboxo($cat, sub { $cmp .= $as_orig->(@_) }); is($cmp, $buf, 'message written to FIFO'); } |