Add --log-file

This commit is contained in:
Ian Gulliver
2016-03-07 11:26:25 -08:00
parent 51eaabe27a
commit 46696933aa
15 changed files with 110 additions and 61 deletions

View File

@@ -107,7 +107,7 @@ static void file_open_wrapper(struct peer *peer) {
file_open(file);
}
static void file_new(char *path, int flags, struct flow *flow, void *passthrough) {
static void file_new(const char *path, int flags, struct flow *flow, void *passthrough) {
flow_ref_inc(flow);
struct file *file = malloc(sizeof(*file));
@@ -133,14 +133,14 @@ void file_cleanup() {
}
}
void file_read_new(char *path, struct flow *flow, void *passthrough) {
void file_read_new(const char *path, struct flow *flow, void *passthrough) {
file_new(path, O_RDONLY, flow, passthrough);
}
void file_write_new(char *path, struct flow *flow, void *passthrough) {
void file_write_new(const char *path, struct flow *flow, void *passthrough) {
file_new(path, O_WRONLY | O_CREAT | O_NOFOLLOW | O_TRUNC, flow, passthrough);
}
void file_append_new(char *path, struct flow *flow, void *passthrough) {
void file_append_new(const char *path, struct flow *flow, void *passthrough) {
file_new(path, O_WRONLY | O_CREAT | O_NOFOLLOW, flow, passthrough);
}