aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2013-08-16 11:30:48 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2013-08-16 11:30:48 -0400
commit0b97e1adbe27a80a7a92284e9d3f12173bd203d1 (patch)
treee621260bfc6036a68cc9076d89ef192b39438efe
parent0edabedc36079e67932c32ea76a7bf12c4824d8f (diff)
parente48d8f7a62a03b783185fcdb4906fd9d063f9c89 (diff)
Merge branch 'master' of github.com:mutantturkey/quikr
-rw-r--r--src/c/multifasta_to_otu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/c/multifasta_to_otu.c b/src/c/multifasta_to_otu.c
index 6d704dd..62d9222 100644
--- a/src/c/multifasta_to_otu.c
+++ b/src/c/multifasta_to_otu.c
@@ -208,12 +208,10 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
- struct dirent result;
-
omp_set_num_threads(jobs);
long done = 0;
printf("Beginning to process samples\n");
-#pragma omp parallel for shared(solutions, sequences, width, result, done)
+ #pragma omp parallel for shared(solutions, sequences, width, done)
for(long i = 0; i < dir_count; i++ ) {
long z = 0;
@@ -225,16 +223,18 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
-#pragma omp critical
- readdir_r(input_directory_dh, &result, &directory_entry);
+ #pragma omp critical
+ {
+ directory_entry = readdir(input_directory_dh);
+ strcpy(base_filename, directory_entry->d_name);
+ }
- if(strcmp(directory_entry->d_name, "..") == 0 || strcmp(directory_entry->d_name, ".") == 0) {
+ if(strcmp(base_filename, "..") == 0 || strcmp(base_filename, ".") == 0) {
i--;
continue;
}
// get our base filenames
- strcpy(base_filename, directory_entry->d_name);
filenames[i] = base_filename;
// get our real filename