static boost::filesystem::path dcp_path;
static std::string device;
static uint64_t const block_size = 4096;
static boost::filesystem::path dcp_path;
static std::string device;
static uint64_t const block_size = 4096;
struct ext4_mbr_bdevs bdevs;
r = ext4_mbr_scan (bd, &bdevs);
if (r != EOK) {
struct ext4_mbr_bdevs bdevs;
r = ext4_mbr_scan (bd, &bdevs);
if (r != EOK) {
/* Re-read the partition table */
int fd = open(device.c_str(), O_RDONLY);
ioctl(fd, BLKRRPART, NULL);
close(fd);
/* Re-read the partition table */
int fd = open(device.c_str(), O_RDONLY);
ioctl(fd, BLKRRPART, NULL);
close(fd);
string partition = device;
/* XXX: don't know if this logic is sensible */
if (partition.size() > 0 && isdigit(partition[partition.length() - 1])) {
string partition = device;
/* XXX: don't know if this logic is sensible */
if (partition.size() > 0 && isdigit(partition[partition.length() - 1])) {
+} catch (CopyError& e) {
+ cout << DIST_WRITER_ERROR "\n" << e.message() << "\n" << e.number() << "\n";
+ cout.flush ();
+} catch (VerifyError& e) {
+ cout << DIST_WRITER_ERROR "\n" << e.message() << "\n" << e.number() << "\n";
+ cout.flush ();
static
void
polkit_callback (GObject *, GAsyncResult* res, gpointer)
{
PolkitAuthorizationResult* result = polkit_authority_check_authorization_finish (polkit_authority, res, 0);
if (result && polkit_authorization_result_get_is_authorized(result)) {
static
void
polkit_callback (GObject *, GAsyncResult* res, gpointer)
{
PolkitAuthorizationResult* result = polkit_authority_check_authorization_finish (polkit_authority, res, 0);
if (result && polkit_authorization_result_get_is_authorized(result)) {
- try {
- write ();
- } catch (CopyError& e) {
- cout << DIST_WRITER_ERROR "\n" << e.message() << "\n" << e.number() << "\n";
- cout.flush ();
- } catch (VerifyError& e) {
- cout << DIST_WRITER_ERROR "\n" << e.message() << "\n" << e.number() << "\n";
- cout.flush ();
- }
polkit_authority = polkit_authority_get_sync (0, 0);
PolkitSubject* subject = polkit_unix_process_new (getppid());
polkit_authority_check_authorization (
polkit_authority, subject, "com.dcpomatic.write-drive", 0, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, 0, polkit_callback, 0
);
polkit_authority = polkit_authority_get_sync (0, 0);
PolkitSubject* subject = polkit_unix_process_new (getppid());
polkit_authority_check_authorization (
polkit_authority, subject, "com.dcpomatic.write-drive", 0, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, 0, polkit_callback, 0
);