]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
inotify: change to proper fd shutdown sequence (clang sanitizer)
authorJaroslav Kysela <perex@perex.cz>
Thu, 10 Mar 2016 08:51:54 +0000 (09:51 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 10 Mar 2016 08:51:54 +0000 (09:51 +0100)
src/dvr/dvr_inotify.c
src/fsmonitor.c

index 0a4d87ce72cd32ed4dde78609f7b08c1ed21b699..71b0ada60a3122197c389e1f033ebbcc6a4e45d9 100644 (file)
@@ -85,11 +85,11 @@ void dvr_inotify_init ( void )
  */
 void dvr_inotify_done ( void )
 {
-  int fd = _inot_fd;
-  _inot_fd = -1;
-  close(fd);
+  shutdown(_inot_fd, SHUT_RDWR);
   pthread_kill(dvr_inotify_tid, SIGTERM);
   pthread_join(dvr_inotify_tid, NULL);
+  close(_inot_fd);
+  _inot_fd = -1;
   SKEL_FREE(dvr_inotify_entry_skel);
 }
 
index 595f6c3af3cdcb4827df53887c5c05516af651aa..a297a3b9648c5cad34024ebf3112be57cc2fd27b 100644 (file)
@@ -115,11 +115,11 @@ fsmonitor_init ( void )
 void
 fsmonitor_done ( void )
 {
-  int fd = fsmonitor_fd;
-  fsmonitor_fd = -1;
-  close(fd);
+  shutdown(fsmonitor_fd, SHUT_RDWR);
   pthread_kill(fsmonitor_tid, SIGTERM);
   pthread_join(fsmonitor_tid, NULL);
+  close(fsmonitor_fd);
+  fsmonitor_fd = -1;
 }
 
 /*