mirror of
https://github.com/NixOS/nix.git
synced 2024-11-26 00:32:28 +00:00
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:
parent
d231d802f5
commit
fa7aa0389a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user