diff options
author | scf <scf@FreeBSD.org> | 2008-04-30 23:27:02 +0000 |
---|---|---|
committer | scf <scf@FreeBSD.org> | 2008-04-30 23:27:02 +0000 |
commit | b502b7ceb03183340bc0bf404507328cef2b454a (patch) | |
tree | dca4dbeadba2c5f8e1f406a795f1829f63c6502e | |
parent | 7db99d1cdd43982226fb5b40e15ede56cc1712be (diff) | |
download | FreeBSD-src-b502b7ceb03183340bc0bf404507328cef2b454a.zip FreeBSD-src-b502b7ceb03183340bc0bf404507328cef2b454a.tar.gz |
Enable autoflush of output to always show prompts. If piping the output
prior to this patch, the prompt would not appear due to buffering.
Approved by: flz
-rw-r--r-- | tools/tools/mfc/mfc.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/tools/mfc/mfc.pl b/tools/tools/mfc/mfc.pl index c862679..18138a8 100644 --- a/tools/tools/mfc/mfc.pl +++ b/tools/tools/mfc/mfc.pl @@ -51,6 +51,7 @@ use warnings; use Env; use Env qw(MFCHOME MFCLOGIN MFCCVSROOT); use Getopt::Std; +use IO::Handle; my $mfchome = $MFCHOME ? $MFCHOME : "/var/tmp/mfc"; my $mfclogin = $MFCLOGIN ? $MFCLOGIN : ""; @@ -77,6 +78,10 @@ my $mfc_func = \&mfc_headers; sub init() { + # Enable autoflush of output to always show prompts. Without this, + # piping output will fail to display a prompt. + autoflush STDOUT 1; + # Look for pre-requisites. my @reqs = ( "fetch", "cvs", "mkdir", "cat", "chmod", "grep" ); my $cmd; |