From: Jaroslav Kysela Date: Mon, 25 Sep 2017 06:30:13 +0000 (+0200) Subject: htsp: move open syscall outside global_lock, issue #4624 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cc3081f04927534b870134565121082eecb47f4;p=thirdparty%2Ftvheadend.git htsp: move open syscall outside global_lock, issue #4624 --- diff --git a/src/htsp_server.c b/src/htsp_server.c index ea3bc7ba7..1868d60b7 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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")); }