Skip to content

Commit

Permalink
print device in case of writing error
Browse files Browse the repository at this point in the history
  • Loading branch information
embetrix committed Dec 19, 2024
1 parent f676ce5 commit 1f68856
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bmap-writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ int BmapWriteImage(const std::string &imageFile, const bmap_t &bmap, const std::
throw std::string("fsync failed after all writes");
}

std::cout << "Finished writing image to device." << std::endl;
std::cout << "Finished writing image to device: " << device << std::endl;
}
catch (const std::string& err) {
std::cerr << err << std::endl;
Expand Down Expand Up @@ -277,7 +277,7 @@ int main(int argc, const char *argv[]) {

std::cout << "Starting bmap writer..." << std::endl;
if (isDeviceMounted(device)) {
std::cerr << "Error: Device " << device << " is mounted. Please unmount it before proceeding." << std::endl;
std::cerr << "Error device: " << device << " is mounted. Please unmount it before proceeding." << std::endl;
return 1;
}
auto start = std::chrono::high_resolution_clock::now();
Expand All @@ -288,7 +288,7 @@ int main(int argc, const char *argv[]) {
}
int ret = BmapWriteImage(imageFile, bmap, device);
if (ret != 0) {
std::cerr << "Failed to write image to device" << std::endl;
std::cerr << "Failed to write image to device: " << device << std::endl;
return ret;
}
auto end = std::chrono::high_resolution_clock::now();
Expand Down

0 comments on commit 1f68856

Please sign in to comment.