FdSource: Fix operator =

This wasn't moving the underlying buffer, so if the buffer was
non-empty, it could lose data.
This commit is contained in:
Eelco Dolstra 2024-07-17 20:37:22 +02:00
parent d231d802f5
commit fa7aa0389a

View file

@ -159,13 +159,7 @@ struct FdSource : BufferedSource
FdSource(Descriptor fd) : fd(fd) { }
FdSource(FdSource &&) = default;
FdSource & operator=(FdSource && s)
{
fd = s.fd;
s.fd = INVALID_DESCRIPTOR;
read = s.read;
return *this;
}
FdSource & operator=(FdSource && s) = default;
bool good() override;
protected: