summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorandmarti1424 <andmarti@gmail.com>2017-05-11 20:37:37 -0300
committerandmarti1424 <andmarti@gmail.com>2017-05-11 20:37:37 -0300
commit7db4b5124f271d7a0b122c101476c7bcdac94934 (patch)
treef38dcc6fa8aa27b0574e6f580cdafa48591fb6d2 /src/main.c
parent12c547495ba9eef6976c20be72ba81f238b30adb (diff)
Change in how pthread_create and pthread_join in controlled
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 24a069c..42c8539 100755
--- a/src/main.c
+++ b/src/main.c
@@ -92,9 +92,8 @@ struct timeval startup_tv, current_tv; //runtime timer
struct timeval lastbackup_tv; // last backup timer
#ifdef HAVE_PTHREAD
#include <pthread.h>
-int pthread_exists; // return status of pthread_create
-pthread_t fthread = 0;
-//pthread_t fthread;
+int pthread_exists = 0; // return status of pthread_create
+pthread_t fthread;
#endif
#endif
@@ -379,7 +378,7 @@ int exit_app(int status) {
// wait for autobackup thread to finish, just in case
#if defined(AUTOBACKUP) && defined(HAVE_PTHREAD)
- if (fthread) pthread_join (fthread, NULL);
+ if (pthread_exists) pthread_join (fthread, NULL);
#endif
// remove backup file