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

Re: [MiNT] stdio write problem in mintlib



>  	setvbuf (stdout, NULL, _IOLBF, 0);
>  	setvbuf (stderr, NULL, _IONBF, 0);
>  
> -	/* Flag device streams.  */
> -	if (isatty (0)) {
> -		if (__mint) stdin->__mode.__binary = 1;
> -	}
> -	if (isatty (1)) {
> -		if (__mint) stdout->__mode.__binary = 1;
> -	} else {
> -		/* If redirected, make stdout fully buffered.  */
> -		setvbuf (stdout, NULL, _IOFBF, 0);
> -	}
> -	if (isatty (2)) {
> -		if (__mint) stderr->__mode.__binary = 1;
> -	}
> -
> +	if (!isatty (1)) {
> +		/* If redirected, make stdout fully buffered.  */
> +		setvbuf (stdout, NULL, _IOFBF, 0);
> +	}

Is there a problem here with stdout ?

At the top we set stdout to LBF (line buffered) which sets __linebuf = 1
in stdio/setvbuf.c. Now if stdout isn't a tty we set the stream to fully
buffered but the code in stdio/setvbuf.c never sets __linebuf to 0.

Is that a problem ?

Alan.