[PATCH][BZ #11741] printf should return negative value on I/O error

Siddhesh Poyarekar siddhesh@redhat.com
Fri Oct 19 09:51:00 GMT 2012


Hi,

Printing padded strings into a file pointer currently succeeds
incorrectly when it should be returning a -1.  I found a number of
problems that together contributed to this bug.  Attached patch fixes
it.  Tested on Fedora 16 x86_64 and also added this case to the current
test case.  No regressions reported resulting from this patch.

I have also added a copyright notice to the test case I modified.  I
got the start date from the ChangeLog.  OK to commit?

Regards,
Siddhesh

ChangeLog:

	[BZ #11741]
	* libio/fileops.c (_IO_new_file_write): Correctly return error.
	* libio/iopadn.c (_IO_padn): Likewise.
	* libio/iowpadn.c (_IO_wpadn): Likewise.
	* stdio-common/tst-put-error.c: Add copyright notice.
	(do_test): Add case for printing padded string.
	* stdio-common/vfprintf [!COMPILE_WPRINTF] (PAD): Flag error if
	_IO_padn returned error.
	[COMPILE_WPRINTF] (PAD): Flag error if _IO_wpadn returned error.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr11741.patch
Type: text/x-patch
Size: 4518 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121019/0696051b/attachment.bin>


More information about the Libc-alpha mailing list