mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02: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
1 changed files with 1 additions and 7 deletions
|
@ -159,13 +159,7 @@ struct FdSource : BufferedSource
|
||||||
FdSource(Descriptor fd) : fd(fd) { }
|
FdSource(Descriptor fd) : fd(fd) { }
|
||||||
FdSource(FdSource &&) = default;
|
FdSource(FdSource &&) = default;
|
||||||
|
|
||||||
FdSource & operator=(FdSource && s)
|
FdSource & operator=(FdSource && s) = default;
|
||||||
{
|
|
||||||
fd = s.fd;
|
|
||||||
s.fd = INVALID_DESCRIPTOR;
|
|
||||||
read = s.read;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool good() override;
|
bool good() override;
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue