Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH 1/2] send-email: refactor and ensure prompting doesn't loop forever

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:31
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On Mon, Mar 30, 2009 at 10:40 AM, Matthieu Moy [off-list ref] wrote:
Jay Soffian [off-list ref] writes:
quoted
Seriously though, I am unable to reproduce the messages you are
getting from Term::ReadLine, and I tried really hard.
Anyway, as I said, the warnings do not harm. They just appear messy in
my log files, but it's really a matter of polishing the UI.
Okay, well, I figured out how to work the polish. Term::ReadLine is
attempting to use /dev/tty for input/output, which is closed. And
because send-email enables warnings, its attempt to do so emits the
messages you are seeing. Can you confirm that this patch squelches the
warnings?
diff --git a/git-send-email.perl b/git-send-email.perl
index f0405c8..1b17728 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -612,6 +612,8 @@ sub ask {
        my $default = $arg{default};
        my $resp;
        my $i = 0;
+       return undef unless defined fileno($term->IN) and
+                           defined fileno($term->OUT);
        while ($i++ < 10) {
                $resp = $term->readline($prompt);
                if (!defined $resp) { # EOF

Thanks,

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help