]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp: move open syscall outside global_lock, issue #4624
authorJaroslav Kysela <perex@perex.cz>
Mon, 25 Sep 2017 06:30:13 +0000 (08:30 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 25 Sep 2017 06:30:13 +0000 (08:30 +0200)
src/htsp_server.c

index ea3bc7ba72e08141bba4b7e8846c9d8018c0ed0a..1868d60b744ba7a7e16e03a49aacfd6d5c7ea08b 100644 (file)
@@ -722,8 +722,10 @@ htsp_file_open(htsp_connection_t *htsp, const char *path, int fd, dvr_entry_t *d
   struct stat st;
 
   if (fd <= 0) {
+    pthread_mutex_unlock(&global_lock);
     fd = tvh_open(path, O_RDONLY, 0);
     tvhdebug(LS_HTSP, "Opening file %s -- %s", path, fd < 0 ? strerror(errno) : "OK");
+    pthread_mutex_lock(&global_lock);
     if(fd == -1)
       return htsp_error(htsp, N_("Unable to open file"));
   }