diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-03-13 21:30:12 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-03-13 21:30:12 +0000 |
commit | 6a682652335eafe4e92f00d7732211fd340a8005 (patch) | |
tree | 8cc3ffe73dbf6e802da67aecc0c1428997cda8ba | |
parent | a4def850ecd30c7a50cca08f0935cf22d47daf46 (diff) |
Ignore ERR_NO_DATA while writing to control socket on Windows, as it
just means that the Pope is being closed.
-rw-r--r-- | lib/server/WinNamedPipeStream.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/server/WinNamedPipeStream.cpp b/lib/server/WinNamedPipeStream.cpp index fedb57d8..9d4ab788 100644 --- a/lib/server/WinNamedPipeStream.cpp +++ b/lib/server/WinNamedPipeStream.cpp @@ -440,14 +440,19 @@ void WinNamedPipeStream::Write(const void *pBuffer, int NBytes) if (!Success) { - DWORD err = GetLastError(); - BOX_ERROR("Failed to write to control socket: " << - GetErrorMessage(err)); - Close(); - // ERROR_NO_DATA is a strange name for // "The pipe is being closed". No exception wanted. + DWORD err = GetLastError(); + + if (err != ERROR_NO_DATA) + { + BOX_ERROR("Failed to write to control " + socket: " << GetErrorMessage(err)); + } + + Close(); + if (err == ERROR_NO_DATA) { return; |