mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 07:46:21 +02:00
Use BackedStringView
This commit is contained in:
parent
a3cf27ca47
commit
1fe8f54bd3
2 changed files with 2 additions and 2 deletions
|
@ -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 a new issue