X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=metadata.cc;h=2ae075190cf49afaed661fd53f66498843bb6a97;hp=f29c48600de0d5b089a86757ac71ab4f6998d478;hb=f38dd9bcb0caffd3fc9126b05788c936690e8288;hpb=0dfc70e01ddb7d2bce0db03d5364c0bd3a2bb308 diff --git a/metadata.cc b/metadata.cc index f29c486..2ae0751 100644 --- a/metadata.cc +++ b/metadata.cc @@ -24,6 +24,8 @@ * handling of the statcache, and re-use of metadata between snapshots. */ +#include +#include #include #include #include @@ -96,7 +98,7 @@ static string encode_dict(const map& dict) string result; if (dict.find("name") != dict.end()) { - result += "name: " + dict.at("name") + "\n"; + result += "name: " + dict.find("name")->second + "\n"; } for (map::const_iterator i = dict.begin(); @@ -116,7 +118,7 @@ MetadataWriter::MetadataWriter(TarSegmentStore *store, { statcache_path = path; statcache_path += "/statcache2"; - if (snapshot_scheme != NULL) + if (snapshot_scheme != NULL && strlen(snapshot_scheme) > 0) statcache_path = statcache_path + "-" + snapshot_scheme; statcache_tmp_path = statcache_path + "." + snapshot_name; @@ -126,7 +128,7 @@ MetadataWriter::MetadataWriter(TarSegmentStore *store, if (statcache_out == NULL) { fprintf(stderr, "Error opening statcache %s: %m\n", statcache_tmp_path.c_str()); - throw IOException("Error opening statcache"); + fatal("Error opening statcache"); } old_metadata_eof = false;