diff options
| author | aspiring_aurelian <tom.wells46@protonmail.com> | 2023-12-08 08:29:27 -0600 |
|---|---|---|
| committer | aspiring_aurelian <tom.wells46@protonmail.com> | 2023-12-08 08:29:27 -0600 |
| commit | 467ccefc2e5b76906f3e5194cc23511087aa9344 (patch) | |
| tree | 62ee28a8f91b3f7c4a87b797dd3bb7038df9eaa1 /main.c | |
| parent | 32b0dd534ff3ab63d51f6e3c5c5a83692aa4fac4 (diff) | |
Add comments
Diffstat (limited to 'main.c')
| -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); |