1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

serialise: fix buffer size used, hide method for internal use only

Fixes #2169.
This commit is contained in:
Will Dietz 2018-05-21 17:26:41 -05:00
parent 966407bcf1
commit b08923b4a0
3 changed files with 9 additions and 5 deletions

View file

@ -133,7 +133,7 @@ size_t FdSource::readUnbuffered(unsigned char * data, size_t len)
ssize_t n;
do {
checkInterrupt();
n = ::read(fd, (char *) data, bufSize);
n = ::read(fd, (char *) data, len);
} while (n == -1 && errno == EINTR);
if (n == -1) { _good = false; throw SysError("reading from file"); }
if (n == 0) { _good = false; throw EndOfFile("unexpected end-of-file"); }