Explicitly set errno on EOF
commit29f1c78da941179aba783ea29316d52c6fa712f5
authorWouter Verhelst <w@uter.be>
Fri, 7 Sep 2018 08:51:21 +0000 (7 10:51 +0200)
committerWouter Verhelst <w@uter.be>
Fri, 7 Sep 2018 08:51:21 +0000 (7 10:51 +0200)
tree95c5ee1c954f25e816ef69e3541b3c1a034eed53
parent67e167803e308dd0d4c40bcfc28a9863dbee536d
Explicitly set errno on EOF

When we reach EOF, that means the other end dropped connection on us,
for which the ECONNRESET errno value is appropriate. However, read()
won't set that by itself, so we need to do it.

This function is also called to read data from our backend export file;
but in that case we know what the size of the export file is and won't
even try to read beyond EOF, so don't worry about that fact.

Fixes: gh-83
cliserv.c