From: Jaroslav Kysela Date: Thu, 10 Mar 2016 08:51:54 +0000 (+0100) Subject: inotify: change to proper fd shutdown sequence (clang sanitizer) X-Git-Tag: v4.2.1~908 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eadfaabf4d0dc10770f062e21ebf193a634a2dae;p=thirdparty%2Ftvheadend.git inotify: change to proper fd shutdown sequence (clang sanitizer) --- diff --git a/src/dvr/dvr_inotify.c b/src/dvr/dvr_inotify.c index 0a4d87ce7..71b0ada60 100644 --- a/src/dvr/dvr_inotify.c +++ b/src/dvr/dvr_inotify.c @@ -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); } diff --git a/src/fsmonitor.c b/src/fsmonitor.c index 595f6c3af..a297a3b96 100644 --- a/src/fsmonitor.c +++ b/src/fsmonitor.c @@ -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; } /*