From 09214652975c5f9f5b92bcee7c12f325a3a7b37b Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Wed, 3 Sep 2014 16:23:13 -0500 Subject: [PATCH] Fix Pipe copy/assignment to make a copy of flags. --- src/Pipe.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Pipe.cc b/src/Pipe.cc index 51298d07b6..3f60409fdb 100644 --- a/src/Pipe.cc +++ b/src/Pipe.cc @@ -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; }