From 467ccefc2e5b76906f3e5194cc23511087aa9344 Mon Sep 17 00:00:00 2001 From: aspiring_aurelian Date: Fri, 8 Dec 2023 08:29:27 -0600 Subject: Add comments --- main.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 752b4a2..1cc6b57 100644 --- a/main.c +++ b/main.c @@ -7,13 +7,13 @@ #include #include -typedef struct thread_data { +typedef struct f_comp_data { char *f1; char *f2; -} thread_data; +} f_comp_data; void *f1_newer(void *arg) { - thread_data *files = (thread_data *) arg; + f_comp_data *files = (f_comp_data *) arg; char *f1 = files->f1; char *f2 = files->f2; struct stat f1_attr; @@ -41,18 +41,21 @@ void *create_make() { int main() { - thread_data files; + /* Struct to hold files */ + f_comp_data files; files.f1 = "main.c"; files.f2 = "./bin/debug"; + /* Threads to: + * create makefile + * check age of source vs. bin + */ pthread_t f_thread, check_thread; pthread_create(&f_thread, NULL, create_make, NULL); pthread_create(&check_thread, NULL, f1_newer, (void *)&files); mkdir("./bin", 0777); - char *source = "main.c"; - char *bin = "./bin/debug"; void *newer; pthread_join(f_thread, NULL); -- cgit v1.2.3