projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update backend code and cumulus-sync for the new backup layout.
[cumulus.git]
/
store.cc
diff --git
a/store.cc
b/store.cc
index
0b03493
..
a77d64a
100644
(file)
--- a/
store.cc
+++ b/
store.cc
@@
-64,7
+64,7
@@
Tarfile::Tarfile(RemoteFile *file, const string &segment)
assert(sizeof(struct tar_header) == TAR_BLOCK_SIZE);
this->file = file;
assert(sizeof(struct tar_header) == TAR_BLOCK_SIZE);
this->file = file;
- this->filter
= FileFilter::New(file->get_fd(), filter_program
);
+ this->filter
.reset(FileFilter::New(file->get_fd(), filter_program)
);
}
Tarfile::~Tarfile()
}
Tarfile::~Tarfile()
@@
-96,7
+96,6
@@
FileFilter *FileFilter::New(int fd, const char *program)
pid_t pid;
int wrapped_fd = spawn_filter(fd, program, &pid);
pid_t pid;
int wrapped_fd = spawn_filter(fd, program, &pid);
- close(fd);
return new FileFilter(fd, wrapped_fd, pid);
}
return new FileFilter(fd, wrapped_fd, pid);
}
@@
-106,6
+105,10
@@
int FileFilter::wait()
if (pid == -1)
return 0;
if (pid == -1)
return 0;
+ // The raw file descriptor was held open to track the output file size, but
+ // is not needed any longer.
+ close(fd_raw);
+
int status;
if (waitpid(pid, &status, 0) < 0) {
fprintf(stderr, "Error waiting for filter process: %m\n");
int status;
if (waitpid(pid, &status, 0) < 0) {
fprintf(stderr, "Error waiting for filter process: %m\n");