summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-03-08 23:37:10 +0100
committerCarl Hetherington <cth@carlh.net>2021-03-09 00:33:00 +0100
commit5983abca09bf21fe47aba493611cd66bae687116 (patch)
treed93a1614252d11e5d0adf9d3904a8ccaf1ae084c
parent78b98af2acc8a919ee23efccc27f656664362998 (diff)
Use /dev/rdisk on macOS.
-rw-r--r--src/tools/dcpomatic_disk_writer.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc
index 6c4221d8a..f33c7974a 100644
--- a/src/tools/dcpomatic_disk_writer.cc
+++ b/src/tools/dcpomatic_disk_writer.cc
@@ -193,7 +193,7 @@ try
LOG_DISK ("Here we go writing %1 to %2", *dcp_path, *device);
-#ifdef DCPOMATIC_LINUX
+#if defined(DCPOMATIC_LINUX)
polkit_authority = polkit_authority_get_sync (0, 0);
PolkitSubject* subject = polkit_unix_process_new_for_owner (getppid(), 0, -1);
Parameters* parameters = new Parameters;
@@ -209,12 +209,11 @@ try
polkit_authority_check_authorization (
polkit_authority, subject, "com.dcpomatic.write-drive", 0, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, 0, polkit_callback, parameters
);
-#else
- string posix_partition = "";
-#ifdef DCPOMATIC_OSX
- posix_partition = *device + "s1";
-#endif
- dcpomatic::write (*dcp_path, *device, posix_partition, nanomsg);
+#elif defined(DCPOMATIC_OSX)
+ string fast_device = boost::algorithm::replace_first_copy (*device, "/dev/disk", "/dev/rdisk");
+ dcpomatic::write (*dcp_path, fast_device, fast_device + "s1", nanomsg);
+#elif defined(DCPOMATIC_WINDOWS)
+ dcpomatic::write (*dcp_path, *device, "", nanomsg);
#endif
}