From 3b42024fcc49ad0603bc3a601ebe32b015d6a381 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 20 Jan 2012 13:15:13 +0200 Subject: Fix incorrect check for error when monitoring a path using inotify. Per the manpage, inotify_add_watch will return -1 in the case of error, 0 is a valid watch descriptor. Task-number: QTBUG-12564 Change-Id: I56a54de2f5cf18b40aaeddc6de51d18dacbf8daf Reviewed-by: Jonas Gastal Reviewed-by: Giuseppe D'Angelo Reviewed-by: Bradley T. Hughes --- src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index ff732bc70e..ce0b8da058 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -277,7 +277,7 @@ QStringList QInotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, | IN_MOVE_SELF | IN_DELETE_SELF ))); - if (wd <= 0) { + if (wd < 0) { perror("QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed"); continue; } -- cgit v1.2.3