summaryrefslogtreecommitdiff
path: root/lib/win32/emu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/win32/emu.cpp')
-rw-r--r--lib/win32/emu.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp
index 48db4ec7..5a61fc3f 100644
--- a/lib/win32/emu.cpp
+++ b/lib/win32/emu.cpp
@@ -667,9 +667,20 @@ HANDLE openfile(const char *pFileName, int flags, int mode)
if (hdir == INVALID_HANDLE_VALUE)
{
+ switch(GetLastError())
+ {
+ case ERROR_SHARING_VIOLATION:
+ errno = EBUSY;
+ break;
+
+ default:
+ errno = EINVAL;
+ }
+
::syslog(LOG_WARNING, "Failed to open file '%s': "
"%s", pFileName,
GetErrorMessage(GetLastError()).c_str());
+
return INVALID_HANDLE_VALUE;
}