Re: [Possible Bug] Use of write on size-limited platforms

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

 



On Mon, Jun 15, 2020 at 06:38:34PM -0400, Randall S. Becker wrote:

> > So I think this really ought to be using write_in_full(). There's only one caller,
> > and I think it would be improved by the switch. Do you want to write a
> > patch?
> > 
> > You could make an argument that the fwrite() version ought to also loop,
> > since it's possible to get a partial write there, too. But we don't do that in
> > general. I suspect in practice most stdio implementations will keep writing
> > until they see an error, and most callers don't bother checking stdio errors at
> > all, or use ferror().
> 
> I'll give the patch a go. It is very simple. Would you suggest
> removing the strbuf_write_fd() as part of this patch since it only
> impacts bugreport.c?

I could go either way on that. IMHO it isn't offering much over a bare
write_in_full() call. The "don't call write() if there are 0 bytes"
logic is part of write_in_full() already.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux