summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sfdb_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-08-12 16:42:07 +0200
committerRobin Gareus <robin@gareus.org>2019-08-12 16:42:07 +0200
commitf7a66619699ab2cd9361384bbc740418f411807a (patch)
treed5cd0660f0d393c8b17270aa9feace90ee45a813 /gtk2_ardour/sfdb_ui.cc
parentffbf40c3d1d5ff12ddc6b48c0b96204f8bb249f0 (diff)
Consolidate: use PBD method to try hard-linking
Diffstat (limited to 'gtk2_ardour/sfdb_ui.cc')
-rw-r--r--gtk2_ardour/sfdb_ui.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 90f6b1944b..8be71138e8 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -50,6 +50,7 @@
#include "pbd/tokenizer.h"
#include "pbd/enumwriter.h"
+#include "pbd/file_utils.h"
#include "pbd/pthread_utils.h"
#include "pbd/string_convert.h"
#include "pbd/xml++.h"
@@ -1721,22 +1722,12 @@ SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths
for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
char tmpc[PATH_MAX+1];
-
snprintf (tmpc, sizeof(tmpc), "%s/%s", tmpdir.c_str(), Glib::path_get_basename (*i).c_str());
/* can we link ? */
-#ifdef PLATFORM_WINDOWS
- /* see also ntfs_link -- msvc only pbd extension */
- if (false == CreateHardLinkA (/*new link*/ tmpc, /*existing file*/ (*i).c_str(), NULL)) {
- goto out;
- }
-#else
- if (link (/*existing file*/(*i).c_str(), tmpc)) {
- goto out;
+ if (PBD::hard_link (/*existing file*/(*i).c_str(), tmpc)) {
+ ::g_unlink (tmpc);
}
-#endif
-
- ::g_unlink (tmpc);
}
ret = true;