summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorandmarti1424 <andmarti@gmail.com>2017-05-10 19:54:31 -0300
committerandmarti1424 <andmarti@gmail.com>2017-05-10 19:54:31 -0300
commit2ae2743743e0e9f925f6515b169812ffcf3631dc (patch)
treedd8700c24a1f09123139df0ea1a08cbb23e9adef /src/main.c
parent0d869b3074bffba76fcc99eb4827f2ae449725f3 (diff)
autobackup: control fthread before joining
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index a61e2b1..c4a7846 100755
--- a/src/main.c
+++ b/src/main.c
@@ -93,8 +93,8 @@ 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;
+pthread_t fthread = 0;
+//pthread_t fthread;
#endif
#endif
@@ -379,7 +379,7 @@ int exit_app(int status) {
// wait for autobackup thread to finish, just in case
#if defined(AUTOBACKUP) && defined(HAVE_PTHREAD)
- if (pthread_exists) pthread_join (fthread, NULL);
+ if (pthread_exists && fthread) pthread_join (fthread, NULL);
#endif
// remove backup file