summaryrefslogtreecommitdiff
path: root/src/system
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-12-16 23:43:51 +0100
committerMax Kellermann <max@musicpd.org>2019-12-16 23:44:20 +0100
commit683d5848f414d1539686df2e0dc886d5252d34fe (patch)
treef082db3606a8afcd4413c88fc32e5394356c51ee /src/system
parentb4496272650f654113be00efddfda1deea8bb5a7 (diff)
parent5680a3a4b71661179b81e6434928d919d186c785 (diff)
Merge tag 'v0.21.17'
release v0.21.17
Diffstat (limited to 'src/system')
-rw-r--r--src/system/Error.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/system/Error.hxx b/src/system/Error.hxx
index a22c3ba29..5027e6864 100644
--- a/src/system/Error.hxx
+++ b/src/system/Error.hxx
@@ -147,6 +147,18 @@ FormatErrno(const char *fmt, Args&&... args) noexcept
return FormatErrno(errno, fmt, std::forward<Args>(args)...);
}
+template<typename... Args>
+static inline std::system_error
+FormatFileNotFound(const char *fmt, Args&&... args) noexcept
+{
+#ifdef _WIN32
+ return FormatLastError(ERROR_FILE_NOT_FOUND, fmt,
+ std::forward<Args>(args)...);
+#else
+ return FormatErrno(ENOENT, fmt, std::forward<Args>(args)...);
+#endif
+}
+
gcc_pure
inline bool
IsErrno(const std::system_error &e, int code) noexcept