diff options
author | Max Kellermann <max@duempel.org> | 2014-07-30 21:59:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-07-30 22:08:26 +0200 |
commit | d1bc46ffad08e070e24f775dd3e13201d97aeb5d (patch) | |
tree | 7811daa9ca326156c4d3b01758cbaeea1bf8ea85 /src/util/Error.cxx | |
parent | 32e5848f345b2a0135989e0e6de85445998c9629 (diff) | |
download | mpd-d1bc46ffad08e070e24f775dd3e13201d97aeb5d.tar.gz mpd-d1bc46ffad08e070e24f775dd3e13201d97aeb5d.tar.xz mpd-d1bc46ffad08e070e24f775dd3e13201d97aeb5d.zip |
util/Error: add SetLastError() overload with "DWORD code" parameter
Diffstat (limited to 'src/util/Error.cxx')
-rw-r--r-- | src/util/Error.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util/Error.cxx b/src/util/Error.cxx index 649276b20..ef8282329 100644 --- a/src/util/Error.cxx +++ b/src/util/Error.cxx @@ -133,11 +133,16 @@ Error::FormatErrno(const char *fmt, ...) #ifdef WIN32 void -Error::SetLastError(const char *prefix) +Error::SetLastError(DWORD _code, const char *prefix) { - DWORD _code = GetLastError(); const char *msg = g_win32_error_message(_code); Format(win32_domain, int(_code), "%s: %s", prefix, msg); } +void +Error::SetLastError(const char *prefix) +{ + SetLastError(GetLastError(), prefix); +} + #endif |