Improved sitefiles

This commit is contained in:
Nate Choe
2022-01-22 03:55:44 -06:00
parent ad64e4ecb2
commit 55da97269b
7 changed files with 93 additions and 73 deletions

View File

@@ -89,18 +89,18 @@ int main(int argc, char **argv) {
fprintf(stderr, "No sitefile configured\n");
exit(EXIT_FAILURE);
}
logs = fopen(logout, "a");
if (logs == NULL) {
fprintf(stderr, "Couldn't open logs file %s\n", logout);
exit(EXIT_FAILURE);
}
Sitefile *site = parseFile(sitefile);
if (site == NULL) {
fprintf(stderr, "Invalid sitefile %s\n", sitefile);
exit(EXIT_FAILURE);
}
logs = fopen(logout, "a");
if (logs == NULL) {
fprintf(stderr, "Couldn't open logs file %s\n", logout);
exit(EXIT_FAILURE);
}
int *pending = calloc(processes - 1, sizeof(int));
int *schedule = malloc(2 * sizeof(int));
if (schedule == NULL)
@@ -114,6 +114,7 @@ int main(int argc, char **argv) {
RunnerArgs *args = malloc(sizeof(RunnerArgs));
if (args == NULL)
exit(EXIT_FAILURE);
args->site = site;
args->pending = pending;
args->schedule = schedule;
args->id = i;