*/
+#include "lib/version.h"
#include "lib/disk_writer_messages.h"
#include "lib/compose.hpp"
#include "lib/exceptions.h"
extern "C" {
#include <lwext4/file_dev.h>
}
+#include <xpc/xpc.h>
#endif
#ifdef DCPOMATIC_LINUX
write (boost::filesystem::path dcp_path, string device)
try
{
-// ext4_dmask_set (DEBUG_ALL);
+ ext4_dmask_set (DEBUG_ALL);
/* We rely on static initialization for these */
static struct ext4_fs fs;
/* XXX: not sure if disk_id matters */
int r = ext4_mbr_write (bd, &parts, 0);
-
if (r) {
throw CopyError ("Failed to write MBR", r);
}
/* Do some basic sanity checks; this is a bit belt-and-braces but it can't hurt... */
#ifdef DCPOMATIC_OSX
- if (!starts_with(*device, "/dev/rdisk")) {
+ if (!starts_with(*device, "/dev/disk")) {
LOG_DISK ("Will not write to %1", *device);
nanomsg->send(DISK_WRITER_ERROR "\nRefusing to write to this drive\n1\n", LONG_TIMEOUT);
return true;
* redirect this to a file in /var/log
*/
dcpomatic_log.reset(new StdoutLog(LogEntry::TYPE_DISK));
- LOG_DISK_NC("dcpomatic_disk_writer started");
+ LOG_DISK("dcpomatic_disk_writer %1 started", dcpomatic_git_commit);
#else
/* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's
* a better place to put them.
LOG_DISK_NC("dcpomatic_disk_writer started");
#endif
+#ifdef DCPOMATIC_OSX
+ /* I *think* this confumes the notifyd event that we used to start the process, so we only
+ * get started once per notification.
+ */
+ xpc_set_event_stream_handler("com.apple.notifyd.matching", DISPATCH_TARGET_QUEUE_DEFAULT, ^(xpc_object_t event) {});
+#endif
+
try {
nanomsg = new Nanomsg (false);
} catch (runtime_error& e) {