[libFuzzer] Properly use unsigned for Process ID.
Use unsigned for PID instead of signed int. GetCurrentProcessId() returns
an unsigned (DWORD) so we must be sure we can deal with all possible values.
I use a long unsigned to be sure it can hold a 32 bit unsigned (DWORD).
Differential Revision: https://reviews.llvm.org/D27281
llvm-svn: 289558
diff --git a/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp b/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp
index abb2680..fc058cd 100644
--- a/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp
+++ b/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp
@@ -87,7 +87,7 @@
sleep(Seconds); // Use C API to avoid coverage from instrumented libc++.
}
-int GetPid() { return getpid(); }
+unsigned long GetPid() { return (unsigned long)getpid(); }
size_t GetPeakRSSMb() {
struct rusage usage;