X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_disk_writer.cc;h=dca09f729ad0ee37bbd4e12906ceac98d4fe146a;hp=cfb610f0a14bd3e07b70ed82515d8ed9e92daac2;hb=6b966acc4b9078989de82daf742b6569b749d0a0;hpb=e6ebc314597b0e52ebfdbc7190d847adc5c6adcb diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc index cfb610f0a..dca09f729 100644 --- a/src/tools/dcpomatic_disk_writer.cc +++ b/src/tools/dcpomatic_disk_writer.cc @@ -177,13 +177,19 @@ try "com.dcpomatic.write-drive", [xml]() { bool const success = Drive(xml).unmount(); - if (!nanomsg->send(success ? (DISK_WRITER_OK "\n") : (DISK_WRITER_ERROR "\n"), LONG_TIMEOUT)) { + bool sent_reply = false; + if (success) { + sent_reply = nanomsg->send(DISK_WRITER_OK "\n", LONG_TIMEOUT); + } else { + sent_reply = nanomsg->send(DISK_WRITER_ERROR "\nCould not unmount drive\n1\n", LONG_TIMEOUT); + } + if (!sent_reply) { LOG_DISK_NC("CommunicationFailedError in unmount_finished"); throw CommunicationFailedError (); } }, []() { - if (!nanomsg->send(DISK_WRITER_ERROR "\n", LONG_TIMEOUT)) { + if (!nanomsg->send(DISK_WRITER_ERROR "\nCould not get permission to unmount drive\n1\n", LONG_TIMEOUT)) { LOG_DISK_NC("CommunicationFailedError in unmount_finished"); throw CommunicationFailedError (); } @@ -266,7 +272,7 @@ try }, []() { if (nanomsg) { - nanomsg->send(DISK_WRITER_ERROR "\nCould not obtain authorization to write to the drive\n", LONG_TIMEOUT); + nanomsg->send(DISK_WRITER_ERROR "\nCould not obtain authorization to write to the drive\n1\n", LONG_TIMEOUT); } }); }