diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-10-23T18·43+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-10-23T18·50+0200 |
commit | 37fbfffd8e23cf9ca4038e6c4145583a811e91aa (patch) | |
tree | 4605d5cdd90bd1a9c5e796278bd40b0acb3ad93c /src/libutil | |
parent | f32cdc4fab1bff919c3d074a95e32a9934eb7386 (diff) |
Pass all settings to build-remote
This ensures that command line flags such as --builders get passed correctly.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/serialise.hh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index 70b193941638..2ea5b6354ee9 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -92,7 +92,17 @@ struct FdSink : BufferedSink FdSink() : fd(-1) { } FdSink(int fd) : fd(fd) { } FdSink(FdSink&&) = default; - FdSink& operator=(FdSink&&) = default; + + FdSink& operator=(FdSink && s) + { + flush(); + fd = s.fd; + s.fd = -1; + warn = s.warn; + written = s.written; + return *this; + } + ~FdSink(); void write(const unsigned char * data, size_t len) override; @@ -112,6 +122,16 @@ struct FdSource : BufferedSource FdSource() : fd(-1) { } FdSource(int fd) : fd(fd) { } + FdSource(FdSource&&) = default; + + FdSource& operator=(FdSource && s) + { + fd = s.fd; + s.fd = -1; + read = s.read; + return *this; + } + size_t readUnbuffered(unsigned char * data, size_t len) override; bool good() override; private: |