diff options
author | Sergej Jaskiewicz <jaskiewiczs@icloud.com> | 2020-04-13 14:26:35 +0300 |
---|---|---|
committer | Sergej Jaskiewicz <jaskiewiczs@icloud.com> | 2020-04-16 15:05:37 +0300 |
commit | 5cef31074ff5ff63a38e0142783849987c598ef8 (patch) | |
tree | f96ad3e212df08655666134364eb32ba1cc068d7 /llvm/lib/Support/LockFileManager.cpp | |
parent | 65a2de7e6c986193a630e691686c527b08f292d5 (diff) | |
download | llvm-5cef31074ff5ff63a38e0142783849987c598ef8.zip llvm-5cef31074ff5ff63a38e0142783849987c598ef8.tar.gz llvm-5cef31074ff5ff63a38e0142783849987c598ef8.tar.bz2 |
Introduce llvm::sys::Process::getProcessId() and adopt it
Differential Revision: https://reviews.llvm.org/D78022
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r-- | llvm/lib/Support/LockFileManager.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp index 88489a6..a2b56ab 100644 --- a/llvm/lib/Support/LockFileManager.cpp +++ b/llvm/lib/Support/LockFileManager.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" #include "llvm/Support/raw_ostream.h" #include <cerrno> @@ -195,12 +196,7 @@ LockFileManager::LockFileManager(StringRef FileName) } raw_fd_ostream Out(UniqueLockFileID, /*shouldClose=*/true); - Out << HostID << ' '; -#if LLVM_ON_UNIX - Out << getpid(); -#else - Out << "1"; -#endif + Out << HostID << ' ' << sys::Process::getProcessId(); Out.close(); if (Out.has_error()) { |