Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [tbm@xxxxxxxxxx: Bug#130817: zsh's echo doesn't error if device is full]



On Jan 27,  3:21pm, Clint Adams wrote:
} Subject: [tbm@xxxxxxxxxx: Bug#130817: zsh's echo doesn't error if device i
}
} I tried putting some error-checking in bin_print, but it didn't seem to
} make much difference.

I suspect it's because bin_print() is using fprintf(), so the output is
buffered by the stdio library and the error doesn't occur until the
stream is flushed.

There are a number of places in bin_print() that look something like:

    if (fout != stdout)
	fclose(fout);

Try changing all of those to the equivalent of:

    if (((fout != stdout) ? fclose(fout) : fflush(fout)) != 0) {
	zwarnnam(name, "write error: %e", NULL, 0);
	ret = 1;
    }

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author