Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: chrome/utility/image_writer/image_writer_mac.cc

Issue 599853002: [Mac] Use raw disks (/dev/rdisk#) in image_writer_mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a DCHECK in WriteChunk. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/image_writer/image_writer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/image_writer/image_writer_mac.cc
diff --git a/chrome/utility/image_writer/image_writer_mac.cc b/chrome/utility/image_writer/image_writer_mac.cc
index c572d1427c318505f737125e20d7c9ad0572205f..8eb4d31a4a025ffc0eef9a305556ad7422dc5c63 100644
--- a/chrome/utility/image_writer/image_writer_mac.cc
+++ b/chrome/utility/image_writer/image_writer_mac.cc
@@ -95,9 +95,15 @@ bool ImageWriter::OpenDevice() {
// Find the file path to open.
base::FilePath real_device_path;
if (device_path_.IsAbsolute()) {
+ // This only occurs for tests where the device path is mocked with a
+ // temporary file.
real_device_path = device_path_;
} else {
- real_device_path = base::FilePath("/dev").Append(device_path_);
+ // Get the raw device file. Writes need to be in multiples of
+ // DAMediaBlockSize (usually 512). This is fine since WriteChunk() writes in
+ // multiples of kMemoryAlignment.
+ real_device_path =
+ base::FilePath("/dev").Append("r" + device_path_.BaseName().value());
}
// Build the command line.
« no previous file with comments | « chrome/utility/image_writer/image_writer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698