Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12564

QInotifyFileSystemWatcherEngine::addPaths rejects valid watch descriptors.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • 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)

      { [ERROR] }

      ----------
      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

        Activity

          People

            w00t Robin Burchell
            volkerl Volker Lukas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes