libutil: remove unused FdSource::specialEndOfFileError

Change-Id: Ia03e270c359014ab3675a043bad342c4bbfdbafd
This commit is contained in:
eldritch horrors
2025-08-06 14:43:47 +00:00
parent 22cf5eb989
commit a9117791e2
2 changed files with 1 additions and 11 deletions
+1 -7
View File
@@ -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");
-4
View File
@@ -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) { }