]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tvhlog: fix the wrong mutex, fixes #3093
authorJaroslav Kysela <perex@perex.cz>
Sat, 19 Sep 2015 19:03:36 +0000 (21:03 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 19 Sep 2015 19:03:36 +0000 (21:03 +0200)
src/tvhlog.c

index fc42d57138eae27f880a0ca7e3258aad37307020..d666198639c7c0c30e8db839bfcf56a9d805b62e 100644 (file)
@@ -467,14 +467,14 @@ tvhlog_class_path_set ( void *o, const void *v )
 {
   const char *s = v;
   if (strcmp(s ?: "", tvhlog_path ?: "")) {
-    pthread_mutex_unlock(&tvhlog_mutex);
+    pthread_mutex_lock(&tvhlog_mutex);
     free(tvhlog_path);
     tvhlog_path = strdup(s ?: "");
     if (tvhlog_path && tvhlog_path[0])
       tvhlog_options |= TVHLOG_OPT_DBG_FILE;
     else
       tvhlog_options &= ~TVHLOG_OPT_DBG_FILE;
-    pthread_mutex_lock(&tvhlog_mutex);
+    pthread_mutex_unlock(&tvhlog_mutex);
     return 1;
   }
   return 0;