diff options
Diffstat (limited to 'runner/resume.c')
-rw-r--r-- | runner/resume.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/runner/resume.c b/runner/resume.c new file mode 100644 index 00000000..b3a2a71e --- /dev/null +++ b/runner/resume.c @@ -0,0 +1,47 @@ +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include "settings.h" +#include "job_list.h" +#include "executor.h" +#include "resultgen.h" + +int main(int argc, char **argv) +{ + struct settings settings; + struct job_list job_list; + struct execute_state state; + int dirfd; + + init_settings(&settings); + init_job_list(&job_list); + + if (argc < 2) { + fprintf(stderr, "Usage: %s results-directory\n", argv[0]); + return 1; + } + + if ((dirfd = open(argv[1], O_RDONLY | O_DIRECTORY)) < 0) { + fprintf(stderr, "Failure opening %s: %s\n", argv[1], strerror(errno)); + return 1; + } + + if (!initialize_execute_state_from_resume(dirfd, &state, &settings, &job_list)) { + return 1; + } + + if (!execute(&state, &settings, &job_list)) { + return 1; + } + + if (!generate_results_path(settings.results_path)) { + return 1; + } + + printf("Done.\n"); + return 0; +} |