Ticket #408: fix-off-by-one-maxfd.patch

File fix-off-by-one-maxfd.patch, 644 bytes (added by Carl Worth, 15 years ago)

Simple patch to fix the bug

  • xapian-core/backends/flint/flint_lock.cc

     
    148148        // Make sure we don't hang on to open files which may get deleted but
    149149        // not have their disk space released until we exit.
    150150        int maxfd = static_cast<int>(sysconf(_SC_OPEN_MAX));
    151         for (int i = 2; i <= maxfd; ++i) {
     151        for (int i = 2; i < maxfd; ++i) {
    152152            if (i != lockfd) {
    153153                // Retry on EINTR; just ignore other errors (we'll get
    154154                // EBADF if the fd isn't open so that's OK).