libutil: remove unused FdSource::specialEndOfFileError
Change-Id: Ia03e270c359014ab3675a043bad342c4bbfdbafd
This commit is contained in:
@@ -197,17 +197,11 @@ size_t FdSource::readUnbuffered(char * data, size_t len)
|
||||
throw SysError("reading from file");
|
||||
}
|
||||
if (n == 0) {
|
||||
throw EndOfFile(endOfFileError());
|
||||
throw EndOfFile("unexpected end-of-file");
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
std::string FdSource::endOfFileError() const
|
||||
{
|
||||
return specialEndOfFileError.has_value() ? *specialEndOfFileError : "unexpected end-of-file";
|
||||
}
|
||||
|
||||
|
||||
size_t StringSource::read(char * data, size_t len)
|
||||
{
|
||||
if (pos == s.size()) throw EndOfFile("end of string reached");
|
||||
|
||||
@@ -152,10 +152,6 @@ private:
|
||||
struct FdSource : BufferedSource
|
||||
{
|
||||
int fd;
|
||||
/** Defaults to "unexpected end-of-file" */
|
||||
std::optional<std::string> specialEndOfFileError;
|
||||
|
||||
std::string endOfFileError() const;
|
||||
|
||||
FdSource() : fd(-1) { }
|
||||
FdSource(int fd) : fd(fd) { }
|
||||
|
||||
Reference in New Issue
Block a user