aboutsummaryrefslogtreecommitdiff
path: root/launcher/FileSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/FileSystem.cpp')
-rw-r--r--launcher/FileSystem.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp
index 6ef1eea7..45c73d24 100644
--- a/launcher/FileSystem.cpp
+++ b/launcher/FileSystem.cpp
@@ -1476,7 +1476,13 @@ bool canLink(const QString& src, const QString& dst)
uintmax_t hardLinkCount(const QString& path)
{
- return fs::hard_link_count(StringUtils::toStdString(path));
+ std::error_code err;
+ int count = fs::hard_link_count(StringUtils::toStdString(path), err);
+ if (err) {
+ qWarning() << "Failed to count hard links for" << path << ":" << QString::fromStdString(err.message());
+ count = 0;
+ }
+ return count;
}
}