Re: [PATCH 15/15] kconf: Check for eof from input stream.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2006-01-08 at 17:34 +0100, Roman Zippel wrote:
> Hi,
> 
> On Wednesday 04 January 2006 23:01, Ben Collins wrote:
> 
> > +static char *fgets_check_stream(char *s, int size, FILE *stream)
> > +{
> > +	char *ret = fgets(s, size, stream);
> > +
> > +	if (ret == NULL && feof(stream)) {
> > +		printf(_("aborted!\n\n"));
> > +		printf(_("Console input is closed. "));
> > +		printf(_("Run 'make oldconfig' to update configuration.\n\n"));
> > +		exit(1);
> > +	}
> > +
> > +	return ret;
> > +}
> 
> What problem does this solve? conf should finish normally anyway and just set 
> everything to the default.

It shouldn't, and it doesn't (that's what defconfig does, I believe).

Anyway, the problem is that if there is no terminal (e.g. stdout is
redirected to a file, and stdin is closed), then kconf loops forever
trying to get an answer (NULL is not the same as "").

-- 
   Ben Collins <[email protected]>
   Developer
   Ubuntu Linux

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux