[Libreoffice] [PUSHED] More read(2) / write(2) cleanup in OSL/unx

Michael Meeks michael.meeks at novell.com
Tue Apr 26 07:18:15 PDT 2011

Hi Julien,

On Sun, 2011-04-24 at 09:00 -0700, Julien Chaffraix wrote:
> following some of my previous changes, here are more change to the way
> we use write(2) and read(2).

	Oooh - pretty :-)

> The changes are made available under LGPLv3+/MPL.

	Thanks for that - I've pushed them. They need a little more work though
(although they are no worse than the original ;-):

	a) safeWrite needs to check for EINTR as safeRead does.

	b) neither safeRead or safeWrite advance the buffer /
	   data pointer when they get a partial read/write - which
	   is broken.
		+ we should have an unsigned char *ptr for both of
		  those, and add nWritten or nRead to it each time
		  we get a partial chunk read.

	Otherwise this is nice :-) It would be sexy to have someone (when this
is all fixed), to isolate and unify all the temp file creation code that
is used all over the place; not all of it is best practise, and there is
a lot of dangerous duplication.

	Thanks !


 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot

More information about the LibreOffice mailing list