diff options
author | Christian Pointner <equinox@helsinki.at> | 2011-04-20 14:40:18 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2011-04-20 14:40:18 (GMT) |
commit | 50eeab7d41466ec0360457b676271fb7a9337d16 (patch) | |
tree | d7bb6343ad38fa7b54af78c85420d357fd907a8e /src | |
parent | c8bc6703879da5a96dbc1319a07fa307cf1892f1 (diff) |
added file_list waitpid function
Diffstat (limited to 'src')
-rw-r--r-- | src/file_list.c | 5 | ||||
-rw-r--r-- | src/file_list.h | 3 | ||||
-rw-r--r-- | src/writer.c | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/file_list.c b/src/file_list.c index c2027a0..ea176ab 100644 --- a/src/file_list.c +++ b/src/file_list.c @@ -139,6 +139,11 @@ int file_list_call_post_process(file_list_t* list, int fd) return 0; } +int file_list_waitpid(file_list_t* list) +{ + return 0; +} + int open_file(file_t* file) { if(!file || file->fd_ > 0) // file already open! diff --git a/src/file_list.h b/src/file_list.h index 4415f12..5dd30d1 100644 --- a/src/file_list.h +++ b/src/file_list.h @@ -51,8 +51,9 @@ typedef struct file_list_struct file_list_t; int file_list_init(file_list_t* list); void file_list_clear(file_list_t* list); file_t* file_list_add(file_list_t* list, struct tm* time, const char* type, const char* format, const char* dir, mode_t mode); -int file_list_call_post_process(file_list_t* list, int fd); int file_list_remove(file_list_t* list, int fd); +int file_list_call_post_process(file_list_t* list, int fd); +int file_list_waitpid(file_list_t* list); int open_file(file_t* file); #endif diff --git a/src/writer.c b/src/writer.c index f5ce2d9..6fb723d 100644 --- a/src/writer.c +++ b/src/writer.c @@ -169,8 +169,6 @@ static int check_boundaries(writer_t* writer) writer->next_ = file_list_add(&(writer->files_), &bd_time, "next", writer->name_format_, writer->output_dir_, writer->mode_); if(writer->next_ == NULL) return -2; - - // TODO: waitpid for post processing scripts and remove file after it has finished } return 0; @@ -192,7 +190,8 @@ static gpointer writer_thread_func(gpointer data) int ret = check_boundaries(writer); if(ret) break; - // TODO: children handling (waitpid) + ret = file_list_waitpid(&(writer->files_)); + if(ret) break; } log_printf(NOTICE, "writer thread stopped"); |