diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp
index 9a5b715..32be62f 100644
a
|
b
|
|
16 | 16 | #include <kcomponentdata.h> |
17 | 17 | #include <kcmdlineargs.h> |
18 | 18 | #include <kdebug.h> |
| 19 | #undef QT_NO_DEBUG_OUTPUT |
19 | 20 | #include <klocale.h> |
20 | 21 | #include <kstandarddirs.h> |
21 | 22 | #include <kshell.h> |
22 | 23 | #include <kurl.h> |
| 24 | #include <klockfile.h> |
23 | 25 | |
24 | 26 | #include <libxml/xmlversion.h> |
25 | 27 | #include <libxml/xmlmemory.h> |
… |
… |
int main(int argc, char **argv) { |
125 | 127 | LIBXML_TEST_VERSION |
126 | 128 | |
127 | 129 | const QString checkFilename = args->arg( 0 ); |
| 130 | #ifdef Q_OS_MAC |
| 131 | // prevent potential issues due to concurrent execution |
| 132 | const QString checkLockFileName = QLatin1String("meinproc4.lock"); |
| 133 | KLockFile checkLock = KLockFile(checkLockFileName); |
| 134 | // give any "competitors" a bit more time than the default before we become impatient |
| 135 | checkLock.setStaleTime(60); |
| 136 | #endif |
128 | 137 | CheckFileResult ckr = checkFile( checkFilename ); |
129 | 138 | if ( ckr != CheckFileSuccess ) |
130 | 139 | { |
… |
… |
int main(int argc, char **argv) { |
188 | 197 | const bool usingOutput = args->isSet("output"); |
189 | 198 | const QString outputOption = args->getOption( "output" ); |
190 | 199 | |
| 200 | #ifdef Q_OS_MAC |
| 201 | if (checkLock.isLocked()) { |
| 202 | qDebug() << "Waiting to get a lock on" << checkLockFileName; |
| 203 | KLockFile::LockResult locked = checkLock.lock(KLockFile::ForceFlag); |
| 204 | qDebug() << "lock result=" << locked; |
| 205 | } |
| 206 | else { |
| 207 | KLockFile::LockResult locked = checkLock.lock(KLockFile::ForceFlag); |
| 208 | if (locked != KLockFile::LockOK) { |
| 209 | qWarning() << "Error locking" << checkLockFileName << "which was not yet locked"; |
| 210 | } |
| 211 | } |
| 212 | #endif |
| 213 | |
191 | 214 | if ( index ) { |
192 | 215 | xsltStylesheetPtr style_sheet = |
193 | 216 | xsltParseStylesheetFile((const xmlChar *)tss.toLatin1().data()); |