"store-crc <path>" command did not save result to <path>, it didn't use <path>
argument and alwayls passed a NULL to "st.traverse" function. now we will create file
<path>, pass a *ofstream to "st.traverse" function.
Fiexes: http://tracker.ceph.com/issues/22092
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
#include <map>
#include <set>
#include <string>
+#include <fstream>
#include <boost/scoped_ptr.hpp>
}
} else if (cmd == "store-crc") {
- uint32_t crc = st.traverse(string(), true, NULL);
- std::cout << "store at '" << path << "' crc " << crc << std::endl;
+ if (argc < 4) {
+ usage(argv[0]);
+ return 1;
+ }
+ std::ofstream fs(argv[4]);
+ uint32_t crc = st.traverse(string(), true, &fs);
+ std::cout << "store at '" << argv[4] << "' crc " << crc << std::endl;
} else if (cmd == "compact") {
st.compact();