mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
parent
8bb4cb0565
commit
91e60868bd
@ -132,7 +132,7 @@ size_t FdSource::readUnbuffered(char * data, size_t len)
|
|||||||
n = ::read(fd, data, len);
|
n = ::read(fd, data, len);
|
||||||
} while (n == -1 && errno == EINTR);
|
} while (n == -1 && errno == EINTR);
|
||||||
if (n == -1) { _good = false; throw SysError("reading from file"); }
|
if (n == -1) { _good = false; throw SysError("reading from file"); }
|
||||||
if (n == 0) { _good = false; throw EndOfFile(endOfFileError); }
|
if (n == 0) { _good = false; throw EndOfFile(std::string(*endOfFileError)); }
|
||||||
read += n;
|
read += n;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ struct FdSource : BufferedSource
|
|||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
size_t read = 0;
|
size_t read = 0;
|
||||||
std::string endOfFileError{"unexpected end-of-file"};
|
BackedStringView endOfFileError{"unexpected end-of-file"};
|
||||||
|
|
||||||
FdSource() : fd(-1) { }
|
FdSource() : fd(-1) { }
|
||||||
FdSource(int fd) : fd(fd) { }
|
FdSource(int fd) : fd(fd) { }
|
||||||
|
Loading…
Reference in New Issue
Block a user