Miscellaneous 'sendfile' fixes and improved tests.
authorMark H Weaver <mhw@netris.org>
Mon, 8 Apr 2013 04:36:00 +0000 (00:36 -0400)
committerMark H Weaver <mhw@netris.org>
Mon, 8 Apr 2013 04:36:00 +0000 (00:36 -0400)
commit7f3be1db9949b0566d3a2cb6bd9d0e84287bbb0a
tree47fdc2104ccb0a0bbeb8761a083e3c89a2f5577f
parenteed0d26cc0668a309b610113554be5df8dfb32e9
Miscellaneous 'sendfile' fixes and improved tests.

* libguile/filesys.c (scm_sendfile): In Linux-style sendfile(2) code, if
  EINTR or EAGAIN occurs, set result to 1 (not 0) so that we actually
  keep going.  In non-sendfile(2) code, deal gracefully with short reads
  due to EOF.

* test-suite/tests/filesys.test ("sendfile"): Use 'let*' to guarantee
  the needed order of operations: write (test-file) and then read it.
  Add code to check the written data (not just the returned length) in
  all tests, including the cases that hit EOF prematurely.
libguile/filesys.c
test-suite/tests/filesys.test