summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
diff options
context:
space:
mode:
authorMarcos Pividori <mpividori@google.com>2017-02-08 00:03:18 +0000
committerMarcos Pividori <mpividori@google.com>2017-02-08 00:03:18 +0000
commit360be4d7ad95a72189ee591e39f8f8ca90e47e33 (patch)
treedb96c87a5207e60aa32317bd161361e99ed7ffb5 /llvm/lib/Fuzzer/FuzzerIOWindows.cpp
parente219d401912ffa8b62dd27fd3f9094cf334de840 (diff)
downloadbcm5719-llvm-360be4d7ad95a72189ee591e39f8f8ca90e47e33.tar.gz
bcm5719-llvm-360be4d7ad95a72189ee591e39f8f8ca90e47e33.zip
[libFuzzer] Properly use Handle instead of FD on Windows.
For Windows, sanitizers work with Handles, not with posix file descriptors, because they use the windows-specific API. So we need to convert the fds to handles before passing them to the sanitizer library. After this change, close_fd_mask is fixed for Windows (this fix some tests too). Differential Revision: https://reviews.llvm.org/D29548 llvm-svn: 294388
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIOWindows.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerIOWindows.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
index 536e1306725..75d4e3a0607 100644
--- a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
@@ -149,6 +149,10 @@ void DiscardOutput(int Fd) {
fclose(Temp);
}
+intptr_t GetHandleFromFd(int fd) {
+ return _get_osfhandle(fd);
+}
+
static bool IsSeparator(char C) {
return C == '\\' || C == '/';
}
OpenPOWER on IntegriCloud