Download | Plain Text | Line Numbers


diff -Naur qmail-scanner-2.01st.orig/sub-patch-st.pl qmail-scanner-2.01st/sub-patch-st.pl
--- qmail-scanner-2.01st.orig/sub-patch-st.pl	2007-02-04 10:52:04.000000000 +0100
+++ qmail-scanner-2.01st/sub-patch-st.pl	2007-11-14 20:45:25.000000000 +0100
@@ -195,6 +195,14 @@
 
   print "\n  Generating $settings_per_domain.db\n\n";
 
+  # delete "__db.[DBNAME]" and "__db.[DBNAME].*"
+  foreach my $tfile ("__db.$settings_per_domain.db.tmp", <__db.$settings_per_domain.db.tmp.*>) {
+    next unless (-e $tfile);
+    if (!unlink($tfile)) {
+      print "ERROR: cannot remove Berkeley DB tmp file $tfile: $!\n";
+      return;
+    }
+  }
   unlink ("$settings_per_domain.db.tmp");
   tie (%domain_settings,'DB_File',"$settings_per_domain.db.tmp",O_CREAT|O_RDWR,0640,$DB_HASH) || &error_condition("cannot open for write $settings_per_domain.db.tmp - $!");