--- SA.pm.old	2004-02-03 09:33:50.000000000 +0000
+++ SA.pm	2004-02-04 09:37:19.000000000 +0000
@@ -120,7 +120,7 @@
 
       # Get an exclusive lock on the bayes rebuild lock file
       my $RebuildLockH = new FileHandle;
-      if ($RebuildLockH->open(">$MailScanner::SA::BayesRebuildLock")) {
+      if ($RebuildLockH->open("+>$MailScanner::SA::BayesRebuildLock")) {
         flock($RebuildLockH, $LOCK_EX)
           or MailScanner::Log::WarnLog("Failed to get exclusive lock on %s, %s",
                        $MailScanner::SA::BayesRebuildLock, $!);
@@ -245,7 +245,7 @@
     $Lockopen = 0;
     $RebuildLockH = new FileHandle;
 
-    if (open($RebuildLockH, ">" . $MailScanner::SA::BayesRebuildLock)) {
+    if (open($RebuildLockH, "+>" . $MailScanner::SA::BayesRebuildLock)) {
       print $RebuildLockH "SpamAssassin Bayes database locked for use by " .
             "MailScanner $$\n";
       #MailScanner::Log::InfoLog("Bayes lock is $RebuildLockH");