]> git.tuebingen.mpg.de Git - paraslash.git/commit
fd: Improve error handling of write_nonblock().
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Dec 2011 18:48:56 +0000 (19:48 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 20 Jan 2012 21:57:06 +0000 (22:57 +0100)
commit65b6448b8eb6f7442ba64affff58c388306a9159
treebdbfeec4cba349db2dfa423d3beeb80947c8eb29
parent748d1368bc96dd7e1af879df1ea41b4d52842f7e
fd: Improve error handling of write_nonblock().

This function had two shortcomings: First, a call to write might
fail with errno set to EINTR in case the write call was interrupted
before any data was written. This is not fatal and one should just
retry the write in this case.

Secondly, POSIX allows to return either EAGAIN or EWOULDBLOCK if the
write would block but we only check for EAGAIN. This is no problem on
Linux since both constants refer to the same value on Linux. However,
POSIX does not require them to be equal, so we have to check for both.

This patch corrects both issues.
fd.c