]> git.tuebingen.mpg.de Git - paraslash.git/commit
fd: Let write_all() return an error on short writes.
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Dec 2011 20:12:13 +0000 (21:12 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 20 Jan 2012 21:57:07 +0000 (22:57 +0100)
commit864024c003d678dbb436cdfc1148b201e4e47018
treeab446df2175986bda9d634fd6a52fea7e3eb81e2
parent65b6448b8eb6f7442ba64affff58c388306a9159
fd: Let write_all() return an error on short writes.

Short writes are often ignored because most callers of write_all()
do not check the return value. Rather than fixing all callers, this
patch teaches write_all() to detect short writes and return the new
E_SHORT_WRITE error code in this case.

Currently write_all() is a wrapper for write(), similar to
write_nonblock() but lacking the safety checks of the latter. To get
these safety checks, write_all() is changed to call write_nonblock().

Unfortunately, this involves some code movement.
error.h
fd.c