about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiP2q.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiP2q.pm')
-rw-r--r--lib/PublicInbox/LeiP2q.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiP2q.pm b/lib/PublicInbox/LeiP2q.pm
index fda055fe..25f63a10 100644
--- a/lib/PublicInbox/LeiP2q.pm
+++ b/lib/PublicInbox/LeiP2q.pm
@@ -107,8 +107,11 @@ sub do_p2q { # via wq_do
         my $in = $self->{0};
         unless ($in) {
                 my $input = $self->{input};
-                if (-e $input) {
-                        $in = $lei->fopen('<', $input) or
+                my $devfd = $lei->path_to_fd($input) // return;
+                if ($devfd >= 0) {
+                        $in = $lei->{$devfd};
+                } elsif (-e $input) {
+                        open($in, '<', $input) or
                                 return $lei->fail("open < $input: $!");
                 } else {
                         my @cmd = (qw(git format-patch --stdout -1), $input);