diff options
| -rw-r--r-- | main.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -7,13 +7,13 @@ #include <sys/wait.h> #include <sys/types.h> -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); |