projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
65da401
)
errno corresponding to ERROR_NO_DATA should be EPIPE (non-threaded RTS)
author
Simon Marlow
<marlowsd@gmail.com>
Wed, 15 Sep 2010 14:18:09 +0000
(14:18 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Wed, 15 Sep 2010 14:18:09 +0000
(14:18 +0000)
rts/win32/IOManager.c
patch
|
blob
|
history
diff --git
a/rts/win32/IOManager.c
b/rts/win32/IOManager.c
index
81dedda
..
c9a759f
100644
(file)
--- a/
rts/win32/IOManager.c
+++ b/
rts/win32/IOManager.c
@@
-16,6
+16,7
@@
#include <io.h>
#include <winsock.h>
#include <process.h>
#include <io.h>
#include <winsock.h>
#include <process.h>
+#include <errno.h>
/*
* Internal state maintained by the IO manager.
/*
* Internal state maintained by the IO manager.
@@
-181,7
+182,15
@@
IOWorkerProc(PVOID param)
len = write(work->workData.ioData.fd,
work->workData.ioData.buf,
work->workData.ioData.len);
len = write(work->workData.ioData.fd,
work->workData.ioData.buf,
work->workData.ioData.len);
- if (len == -1) { errCode = errno; }
+ if (len == -1) {
+ errCode = errno;
+ // write() gets errno wrong for
+ // ERROR_NO_DATA, we have to fix it here:
+ if (errCode == EINVAL &&
+ GetLastError() == ERROR_NO_DATA) {
+ errCode = EPIPE;
+ }
+ }
}
complData = work->workData.ioData.buf;
fd = work->workData.ioData.fd;
}
complData = work->workData.ioData.buf;
fd = work->workData.ioData.fd;