]> 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>
Fri, 29 Sep 2017 07:35:06 +0000 (09:35 +0200)
src/htsp_server.c

index 69a0326947ff831ad66a06a6b451e541848a4fa5..6e1e71aa65fa6d0265c267152c92f9e2d0f27915 100644 (file)
@@ -718,8 +718,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"));
   }