Re: [PATCH v2 1/3] console: don't count newlines twice in bytes written

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

 



On Wed, Jul 31, 2019 at 12:21:41PM +0200, Ahmad Fatoum wrote:
> Both the PBL and simple console only return number of input bytes, not
> number of bytes actually written out. These differ, because each LF is
> converted to CRLF pairs.
> 
> The behavior of not counting actual written out characters is more sensible,
> because otherwise callers interested in finding out if all bytes have been
> written (e.g. to avoid incomplete writes with ratp) would need to keep count
> of all line feeds in the string.
> Therefore change the normal console to behave like its less featureful
> brethren.

According to "man puts" puts() returns a non negative number on success.
I can't find a place where it's claimed that we have to return the
number of characters. I also can't find a place where the return value
of any puts like function in barebox is ever evaluated. Given that it
might make more sense to just return zero in the absense of an error.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux