Index: trunk/Nebulous-Server/bin/nebdiskd
===================================================================
--- trunk/Nebulous-Server/bin/nebdiskd	(revision 19886)
+++ trunk/Nebulous-Server/bin/nebdiskd	(revision 20134)
@@ -3,5 +3,5 @@
 # Copyright (C) 2007  Joshua Hoblitt
 # 
-# $Id: nebdiskd,v 1.11 2008-10-03 21:56:36 jhoblitt Exp $
+# $Id: nebdiskd,v 1.12 2008-10-14 02:56:30 jhoblitt Exp $
 
 use strict;
@@ -124,11 +124,6 @@
 
         eval {
-            # empty the mount table
-            $dbh->do("DELETE FROM mount");
-            print "flushed mount table\n" if $debug;
-
-            # repopulate the mount table with all valid mounts that we are
-            # supposed to be watching
-            my $query = $dbh->prepare_cached("INSERT INTO mount VALUES(?, ?, ?)");
+            my $r_query = $dbh->prepare_cached("REPLACE INTO mount VALUES(?, ?, ?)");
+            my $d_query = $dbh->prepare_cached("DELETE FROM mount WHERE mountpoint = ?");
 
             # determine valid mountpoints
@@ -139,10 +134,10 @@
                 eval {
                     unless (is_mountpoint($mnt)) {
-                        print "$mnt is not a valid mountpoint\n" if $debug;
-                        next;
+                        die "$mnt is not a valid mountpoint\n";
                     }
                 };
                 if ($@) {
-                    print "$mnt is not a valid mountpoint\n" if $debug;
+                    print $@ if $debug;
+                    $d_query->execute($mnt);
                     next;
                 }
@@ -157,5 +152,5 @@
                 }
 
-                $query->execute($mnt, @$dev_info{qw( blocks used )});
+                $r_query->execute($mnt, @$dev_info{qw( blocks used )});
                 print "adding $mnt to db\n" if $debug;
 
