#ifdef DCPOMATIC_LINUX
static PolkitAuthority* polkit_authority = 0;
#endif
-static uint64_t const block_size = 4096;
+/* Use quite a big block size here, as ext4's fwrite() has quite a bit of overhead */
+static uint64_t const block_size = 4096 * 4096;
static Nanomsg* nanomsg = 0;
#define SHORT_TIMEOUT 100
uint8_t* buffer = new uint8_t[block_size];
Digester digester;
- int progress_frequency = 5000;
+ int progress_frequency = 1;
int progress_count = 0;
uint64_t remaining = file_size (from);
while (remaining > 0) {
if (*s == DISK_WRITER_QUIT) {
exit (EXIT_SUCCESS);
+ } else if (*s == DISK_WRITER_PING) {
+ nanomsg->send(DISK_WRITER_PONG "\n", LONG_TIMEOUT);
} else if (*s == DISK_WRITER_UNMOUNT) {
/* XXX: should do Linux polkit stuff here */
optional<string> xml_head = nanomsg->receive (LONG_TIMEOUT);
/* 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) {});
+ xpc_set_event_stream_handler("com.apple.notifyd.matching", DISPATCH_TARGET_QUEUE_DEFAULT, ^(xpc_object_t) {});
#endif
try {