]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epggrab: try to fix the thread kill & wrong memory access
authorJaroslav Kysela <perex@perex.cz>
Mon, 1 Dec 2014 20:25:15 +0000 (21:25 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 1 Dec 2014 20:25:15 +0000 (21:25 +0100)
src/epggrab/module.c
src/wrappers.c

index 826cf219dfd662c643cab4241c3699b3fb7a9c0a..8351de22f704d13c0ad48ebbe3c4555ddb4718e1 100644 (file)
@@ -248,6 +248,7 @@ epggrab_module_int_done( void *m )
 {
   epggrab_module_int_t *mod = m;
   free((char *)mod->path);
+  mod->path = NULL;
 }
 
 epggrab_module_int_t *epggrab_module_int_create
@@ -416,7 +417,7 @@ epggrab_module_done_socket( void *m )
   shutdown(sock, SHUT_RDWR);
   close(sock);
   if (mod->tid) {
-    pthread_kill(mod->tid, SIGTERM);
+    pthread_kill(mod->tid, SIGQUIT);
     pthread_join(mod->tid, NULL);
   }
   mod->tid = 0;
index ddee69e3c693f42f091d82bce254e6b089b5cf2d..9d8fa6a61c19147b799fc4c451805793c30c5b3d 100644 (file)
@@ -104,6 +104,9 @@ tvh_fopen(const char *filename, const char *mode)
   return f;
 }
 
+static void doquit(int sig)
+{
+}
 
 struct
 thread_state {
@@ -130,9 +133,11 @@ thread_wrapper ( void *p )
 
   sigemptyset(&set);
   sigaddset(&set, SIGTERM);
+  sigaddset(&set, SIGQUIT);
   pthread_sigmask(SIG_UNBLOCK, &set, NULL);
 
   signal(SIGTERM, doexit);
+  signal(SIGQUIT, doquit);
 
   /* Run */
   tvhtrace("thread", "created thread %ld [%s / %p(%p)]",