From 773aec51ce7dbeda2a9b2ffae471de76e8953a70 Mon Sep 17 00:00:00 2001 From: xushaohua Date: Thu, 15 Mar 2018 15:25:56 +0800 Subject: [PATCH] Enable nonblocking mode in filesystem watcher Change-Id: I525d32660732a8c686fc02ed52639b4338a9c3b6 --- src/filesystem/dfilesystemwatcher_linux.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filesystem/dfilesystemwatcher_linux.cpp b/src/filesystem/dfilesystemwatcher_linux.cpp index 17fcac3..4be4b4f 100644 --- a/src/filesystem/dfilesystemwatcher_linux.cpp +++ b/src/filesystem/dfilesystemwatcher_linux.cpp @@ -420,10 +420,10 @@ DFileSystemWatcher::DFileSystemWatcher(QObject *parent) { int fd = -1; #ifdef IN_CLOEXEC - fd = inotify_init1(IN_CLOEXEC); + fd = inotify_init1(IN_CLOEXEC | O_NONBLOCK); #endif if (fd == -1) { - fd = inotify_init(); + fd = inotify_init1(O_NONBLOCK); } if (fd != -1) -- 2.30.2