Use /dev/rdisk on macOS.
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Mar 2021 22:37:10 +0000 (23:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 Mar 2021 22:28:27 +0000 (23:28 +0100)
src/tools/dcpomatic_disk_writer.cc

index 6c4221d8a7b337c199b4eafb31f8c5d50488ce61..f33c7974aa6ce90dbb07bc91cfa418c49e9b8d84 100644 (file)
@@ -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
        }