Re: 2.5: troubles with piping make output

From: Russell King (rmk@arm.linux.org.uk)
Date: Sun Nov 03 2002 - 15:24:46 EST


On Sun, Nov 03, 2002 at 09:10:54PM +0100, Roman Zippel wrote:
> > Looks like fflush() got forgotten somewhere ;)
>
> What shell are you using?
> This is what should happen:
>
> $ make 2>&1 | tee
> make[1]: `scripts/kconfig/conf' is up to date.
> ./scripts/kconfig/conf -s arch/i386/Kconfig
> #
> # using defaults found in .config
> #
> *
> * Restart config...
> *
> *
> * Processor type and features
> *
> Processor family (386, 486, 586/K5/5x86/6x86/6x86MX, Pentium-Classic, Pentium-MMX, Pentium-Pro/Celeron/Pentium-II, Pentium-III/Celeron(Coppermine), Pentium-4, K6/K6-II/K6-III, Athlon/Duron/K7, Elan, Crusoe, Winchip-C6, Winchip-2, Winchip-2A/Winchip-3, CyrixIII/VIA-C3) [Pentium-Pro/Celeron/Pentium-II] (NEW) aborted!
>
> Console input/output is redirected. Run 'make oldconfig' to update configuration.
>
> make: *** [include/linux/autoconf.h] Error 1

No thanks. That breaks my build scripts. I don't want to go logging into
multiple machines just to run make oldconfig when the old system worked
perfectly well.

"perfectly well" here means that make oldconfig worked over ssh, with the
local end logging the stdout to a file as well as the terminal, with stdin
from the terminal. It is quite reasonable to expect the configuration to
continue as normal.

So, here's a patch that adds the necessary fflush to make this situation
work (for me at least.)

diff -u orig/scripts/kconfig/conf.c linux/scripts/kconfig/conf.c
--- orig/scripts/kconfig/conf.c Sat Nov 2 18:58:34 2002
+++ linux/scripts/kconfig/conf.c Fri Nov 1 17:02:19 2002
@@ -115,6 +115,7 @@
                         exit(1);
                 }
         case ask_all:
+ fflush(stdout);
                 fgets(line, 128, stdin);
                 return;
         case set_default:

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 07 2002 - 22:00:30 EST