util/disk_cache: add a write helper
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 15 Mar 2017 23:09:32 +0000 (01:09 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 21 Mar 2017 00:51:03 +0000 (11:51 +1100)
commitb9a370f2b4fc5b857ca06f7e5a07cb04219ca9d1
tree42d56b1c3bbc815ac1f42d3c6dbb3c44b37ffb7d
parentaf73acca2b3f3e1adbdff62e0ca085979dc5974c
util/disk_cache: add a write helper

Simplifies the write code a bit and handles EINTR.

V2: (Timothy Arceri) Drop EINTR handling. To do it
    properly we would need a retry limit but it's
    probably best to just avoid trying to write if
    we hit EINTR and try again next time we see
    the program.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/util/disk_cache.c