Permalink
Browse files

Add PackCommand

  • Loading branch information...
rocallahan committed Jun 14, 2017
1 parent f06907d commit a2a91adad09daa478f3a00aa102e169814abb40a
View
@@ -282,6 +282,7 @@ set(RR_SOURCES
src/MmappedFileMonitor.cc
src/MonitoredSharedMemory.cc
src/Monkeypatcher.cc
+ src/PackCommand.cc
src/PerfCounters.cc
src/ProcFdDirMonitor.cc
src/ProcMemMonitor.cc
@@ -311,7 +312,9 @@ set(RR_SOURCES
src/TraceStream.cc
src/VirtualPerfCounterMonitor.cc
src/util.cc
- src/WaitStatus.cc)
+ src/WaitStatus.cc
+ third-party/blake2/blake2b.c
+)
function(post_build_executable target)
# grsecurity needs these. But if we add them ourselves, they may conflict
View
@@ -199,7 +199,7 @@ void CompressedWriter::compression_thread() {
pthread_mutex_unlock(&mutex);
}
-void CompressedWriter::close() {
+void CompressedWriter::close(Sync sync) {
if (!fd.is_open()) {
return;
}
@@ -215,6 +215,16 @@ void CompressedWriter::close() {
pthread_join(*i, nullptr);
}
+ if (sync == SYNC) {
+ if (fsync(fd) < 0) {
+ error = true;
+ }
+ }
+
+ if (write_error) {
+ error = true;
+ }
+
fd.close();
}
View
@@ -38,8 +38,9 @@ class CompressedWriter {
bool good() const { return !error; }
// Call only on producer thread.
void write(const void* data, size_t size);
+ enum Sync { DONT_SYNC, SYNC };
// Call only on producer thread
- void close();
+ void close(Sync sync = DONT_SYNC);
struct BlockHeader {
uint32_t compressed_length;
Oops, something went wrong.

0 comments on commit a2a91ad

Please sign in to comment.