From 13f302149a2a2846d801689e3d194af3249ed0b7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 27 Apr 2020 23:44:06 +0200 Subject: [PATCH] Experimental use of /dev/rdisk rather than /dev/disk on macOS, as there is some suggestion it is faster. --- src/lib/cross.h | 2 ++ src/lib/cross_linux.cc | 7 +++++++ src/lib/cross_osx.cc | 10 ++++++++++ src/lib/cross_windows.cc | 7 +++++++ 4 files changed, 26 insertions(+) diff --git a/src/lib/cross.h b/src/lib/cross.h index 114581269..d8296e217 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -117,6 +117,8 @@ public: return _device; } + std::string device_for_write () const; + bool mounted () const { return !_mount_points.empty(); } diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc index 36683a0cd..983dbb669 100644 --- a/src/lib/cross_linux.cc +++ b/src/lib/cross_linux.cc @@ -344,6 +344,13 @@ Drive::unmount () } +string +Drive::device_for_write () const +{ + return device (); +} + + void unprivileged () { diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 6e8ef168c..66be376d4 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -493,6 +493,16 @@ Drive::get () return drives; } + +string +Drive::device_for_write () const +{ + string w = _device; + boost::replace_all (w, "/dev/disk", "/dev/rdisk"); + return w; +} + + boost::filesystem::path config_path () { diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index 8ccc790d6..96c69d780 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -596,6 +596,13 @@ Drive::unmount () } +string +Drive::device_for_write () const +{ + return device (); +} + + boost::filesystem::path config_path () { -- 2.30.2