inotify: Block signals in the inotify thread.
Otherwise, we may get invalid reads due to double-handling of signals.
This commit is contained in:
@ -641,7 +641,7 @@ inotify_remove_directory(int fd, const char * path)
|
||||
}
|
||||
|
||||
void *
|
||||
start_inotify()
|
||||
start_inotify(void)
|
||||
{
|
||||
struct pollfd pollfds[1];
|
||||
int timeout = 1000;
|
||||
@ -650,6 +650,10 @@ start_inotify()
|
||||
int length, i = 0;
|
||||
char * esc_name = NULL;
|
||||
struct stat st;
|
||||
sigset_t set;
|
||||
|
||||
sigfillset(&set);
|
||||
pthread_sigmask(SIG_BLOCK, &set, NULL);
|
||||
|
||||
pollfds[0].fd = inotify_init();
|
||||
pollfds[0].events = POLLIN;
|
||||
|
Reference in New Issue
Block a user