SVN commit 949261 by bbroeksema: Finish the MBox::open() method and modify the procmail_lock test to ensure that the mbox file itself is actually locked. M +2 -1 mbox.cpp M +3 -1 tests/mboxtest.cpp --- trunk/KDE/kdepim/akonadi/resources/mbox/libmbox/mbox.cpp #949260:949261 @@ -151,8 +151,9 @@ if (int rc = lock() != 0) return rc; + fcntl(fileno(d->mStream), F_SETFD, FD_CLOEXEC); - return 0; + return errno; } void MBox::setLockType(LockType ltype) --- trunk/KDE/kdepim/akonadi/resources/mbox/libmbox/tests/mboxtest.cpp #949260:949261 @@ -105,7 +105,9 @@ QVERIFY(!QFile(fileName() + ".lock").exists()); mbox.open(); QVERIFY(QFile(fileName() + ".lock").exists()); - mbox.close(); + QFile file(fileName()); + QVERIFY(!file.open(QFile::ReadWrite)); // The file should be locked so open + mbox.close(); // should fail. QVERIFY(!QFile(fileName() + ".lock").exists()); } else { QVERIFY(!QFile(fileName() + ".lock").exists());