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-Tag: v4.2.4~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd69ac16827822f0ca6f994ca0fe7f1e3665b61b;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 69a032694..6e1e71aa6 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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")); }