1
0
mirror of https://gittea.dev/nova/th.git synced 2025-12-09 09:10:10 -05:00

indentation change, now using continue

This commit is contained in:
nova
2025-11-15 22:28:08 +01:00
parent 9a67b35ebe
commit 74166f7283

View File

@@ -63,8 +63,9 @@ void *thread_mid(){
mid_content = malloc(sizeof(file));
mid_content->file_name = "cannot open directory";
mid_file_count = 1;
} else {
pthread_mutex_unlock(&mutex_mid);
continue;
}
char *path = malloc(strlen(global_path)+1);
memcpy(path, global_path, strlen(global_path)+1);
@@ -102,7 +103,6 @@ void *thread_mid(){
pthread_cond_signal(&cond_btm);
free(path);
}
pthread_mutex_unlock(&mutex_mid);
}
pthread_exit(0);
@@ -118,7 +118,9 @@ void *thread_lft(){
lft_content = malloc(sizeof(file));
lft_content[0].file_name = "cannot open directory";
lft_file_count = 1;
} else {
pthread_mutex_unlock(&mutex_lft);
continue;
}
char *path = malloc(strlen(global_path)+1);
memcpy(path, global_path, strlen(global_path)+1);
@@ -134,14 +136,12 @@ void *thread_lft(){
memset(lft_content, '\0', lft_file_count * sizeof(file));
get_dir_content(path, &lft_file_count, lft_content);
}
} else {
lft_file_count = 0;
}
free(path);
}
pthread_mutex_unlock(&mutex_lft);
}
pthread_exit(0);
@@ -244,11 +244,12 @@ void *thread_top(){
top_buffer = malloc(sizeof("cannot open directory"));
top_width = sizeof("cannot open directory");
top_buffer = "cannot open directory";
} else {
pthread_mutex_unlock(&mutex_top);
continue;
}
top_buffer = malloc(strlen(global_path)+1);
memcpy(top_buffer, global_path, strlen(global_path)+1);
top_width = strlen(top_buffer);
}
pthread_mutex_unlock(&mutex_top);
}