From: xushaohua Date: Thu, 15 Mar 2018 07:25:56 +0000 (+0800) Subject: Enable nonblocking mode in filesystem watcher X-Git-Tag: archive/raspbian/5.7.12-2+rpi1^2~122^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1695236cca61aba7efe5280dbb9f38d3608c3f18;p=dtkcore.git Enable nonblocking mode in filesystem watcher Change-Id: I525d32660732a8c686fc02ed52639b4338a9c3b6 --- 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)