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. |