Replace boost::scoped_ptr with std::unique_ptr.
[cumulus.git] / metadata.cc
index 15bd7a5..96d21ea 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <sys/sysmacros.h>
 #include <string>
 #include <iostream>
 #include <map>
@@ -373,7 +374,7 @@ void MetadataWriter::add(dictionary info)
 
     if (info == old_metadata && !flag_full_metadata) {
         ObjectReference ref = ObjectReference::parse(old_metadata_loc);
-        if (!ref.is_null()) {
+        if (!ref.is_null() && db->IsAvailable(ref)) {
             item.reused = true;
             item.ref = ref;
         }