Fix incorrect check for error when monitoring a path using inotify.
authorRobin Burchell <robin.burchell@collabora.com>
Fri, 20 Jan 2012 11:15:13 +0000 (13:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sat, 21 Jan 2012 04:07:06 +0000 (05:07 +0100)
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 <jgastal@profusion.mobi>
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
src/corelib/io/qfilesystemwatcher_inotify.cpp

index ff732bc..ce0b8da 100644 (file)
@@ -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;
         }