remove unnecessary existence checks.
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 8 Mar 2007 13:14:30 +0000 (13:14 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 8 Mar 2007 13:14:30 +0000 (13:14 +0000)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@351 be28352e-c001-0410-b1a7-c7978e42abec

src/uk/ac/vamsas/client/simpleclient/FileLock.java

index ef29f47..c7d6150 100644 (file)
@@ -34,8 +34,11 @@ public class FileLock extends Lock {
     try { 
       advisory=new NativeLock(_lock, block);
     } catch (Exception e) {
-      log.fatal("Failed to create advisory lock file "+_lock,e);
-      throw new Error("Failed to create advisory lock file "+_lock);          
+      if (!_lock.exists()) {
+        // advisory cannot be created. this is serious.
+        log.fatal("Failed to create advisory lock file "+_lock,e);
+        throw new Error("Failed to create advisory lock file "+_lock);
+      }
     }
     return advisory.isLocked();
   }