Fix Pipe copy/assignment to make a copy of flags.

This commit is contained in:
Jon Siwek 2014-09-03 16:23:13 -05:00
parent 77955d7677
commit 0921465297

View file

@ -64,6 +64,8 @@ Pipe::Pipe(const Pipe& other)
{
fds[0] = dup_or_fail(other.fds[0], other.flags[0]);
fds[1] = dup_or_fail(other.fds[1], other.flags[1]);
flags[0] = other.flags[0];
flags[1] = other.flags[1];
}
Pipe& Pipe::operator=(const Pipe& other)
@ -75,5 +77,7 @@ Pipe& Pipe::operator=(const Pipe& other)
close(fds[1]);
fds[0] = dup_or_fail(other.fds[0], other.flags[0]);
fds[1] = dup_or_fail(other.fds[1], other.flags[1]);
flags[0] = other.flags[0];
flags[1] = other.flags[1];
return *this;
}