Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-03-16 18:08:13 +0000
committerChris Goldthorpe2009-03-16 18:08:13 +0000
commitb7c74ebdf9b0bb981553168b33a98626bb5d12df (patch)
treed99ae2a431d2557709a4bf17eda745e767d83ab9 /org.eclipse.help.base
parent6ce5b1f8e369665ff756be41f6ce6d1125add52f (diff)
downloadeclipse.platform.ua-b7c74ebdf9b0bb981553168b33a98626bb5d12df.tar.gz
eclipse.platform.ua-b7c74ebdf9b0bb981553168b33a98626bb5d12df.tar.xz
eclipse.platform.ua-b7c74ebdf9b0bb981553168b33a98626bb5d12df.zip
Bug 236046 – [Help][Search] Search does not get indexed on hpux
Diffstat (limited to 'org.eclipse.help.base')
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java
index 7a6de3b0c..85a6137ae 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -918,6 +918,9 @@ public class SearchIndex implements ISearchIndex {
* if lock already obtained
*/
public synchronized boolean tryLock() throws OverlappingFileLockException {
+ if ("none".equals(System.getProperty("osgi.locking"))) { //$NON-NLS-1$//$NON-NLS-2$
+ return true; // Act as if lock succeeded
+ }
if (lock != null) {
throw new OverlappingFileLockException();
}
@@ -930,12 +933,23 @@ public class SearchIndex implements ISearchIndex {
lock = l;
return true;
}
+ logLockFailure(null);
} catch (IOException ioe) {
lock = null;
+ logLockFailure(ioe);
}
return false;
}
+ private static boolean errorReported = false;
+
+ private void logLockFailure(IOException ioe) {
+ if (!errorReported) {
+ HelpBasePlugin.logError("Unable to Lock Help Search Index", ioe); //$NON-NLS-1$
+ errorReported = true;
+ }
+ }
+
private File getLockFile() {
return new File(indexDir.getParentFile(), locale + ".lock"); //$NON-NLS-1$
}

Back to the top