Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.3, 4.7.0
-
None
-
x86_64-unknown-linux-gnu
-
3b42024fcc49ad0603bc3a601ebe32b015d6a381
Description
There is an error in the QInotifyFileSystemWatcherEngine::addPaths function. The function attempts to register a file for watching and then checks whether the returned descriptor is valid like in the following pseudo-code fragment:
----------
int wd = inotify_add_watch([...]);
if (wd <= 0)
----------
The problem is that this treats a return value of 0 as invalid. According to the inotify_add_watch man page, a 0 is a valid value. Current versions of Linux do not actually return 0, for compatibility with programs which came to rely on 0 not being returned. Nevertheless that value could be returned in principle (Compare http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=08e53fcb0db34baca3db84a457b6d67faabee4c6).
Attachments
For Gerrit Dashboard: QTBUG-12564 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
13806,1 | Fix incorrect check for error when monitoring a path using inotify. | master | qt/qtbase | Status: MERGED | +2 | 0 |