}
if (opt_cmd == OPT_BILOG_LIST) {
+ if (bucket_name.empty()) {
+ cerr << "ERROR: bucket not specified" << std::endl;
+ return -EINVAL;
+ }
+ int ret = init_bucket(bucket_name, bucket);
+ if (ret < 0) {
+ cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
+ return -ret;
+ }
formatter->open_array_section("entries");
bool truncated;
int count = 0;
do {
list<rgw_bi_log_entry> entries;
- int ret = store->list_bi_log_entries(bucket, marker, max_entries - count, entries, &truncated);
+ ret = store->list_bi_log_entries(bucket, marker, max_entries - count, entries, &truncated);
if (ret < 0) {
cerr << "ERROR: list_bi_log_entries(): " << cpp_strerror(-ret) << std::endl;
return -ret;