Skip to content

Commit 7d71172

Browse files
author
git apple-llvm automerger
committed
Merge commit 'fb17bc70acd7' from llvm.org/main into next
2 parents 3637b35 + fb17bc7 commit 7d71172

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ static Status EnsureFDFlags(int fd, int flags) {
218218
static llvm::Error AddPtraceScopeNote(llvm::Error original_error) {
219219
Expected<int> ptrace_scope = GetPtraceScope();
220220
if (auto E = ptrace_scope.takeError()) {
221-
Log *log = GetLog(POSIXLog::Process);
222-
LLDB_LOG(log, "error reading value of ptrace_scope: {0}", E);
221+
LLDB_LOG_ERROR(GetLog(POSIXLog::Process), std::move(E),
222+
"error reading value of ptrace_scope: {0}");
223223

224224
// The original error is probably more interesting than not being able to
225225
// read or interpret ptrace_scope.
@@ -230,6 +230,7 @@ static llvm::Error AddPtraceScopeNote(llvm::Error original_error) {
230230
switch (*ptrace_scope) {
231231
case 1:
232232
case 2:
233+
llvm::consumeError(std::move(original_error));
233234
return llvm::createStringError(
234235
std::error_code(errno, std::generic_category()),
235236
"The current value of ptrace_scope is %d, which can cause ptrace to "
@@ -239,6 +240,7 @@ static llvm::Error AddPtraceScopeNote(llvm::Error original_error) {
239240
"https://www.kernel.org/doc/Documentation/security/Yama.txt.",
240241
*ptrace_scope);
241242
case 3:
243+
llvm::consumeError(std::move(original_error));
242244
return llvm::createStringError(
243245
std::error_code(errno, std::generic_category()),
244246
"The current value of ptrace_scope is 3, which will cause ptrace to "

0 commit comments

Comments
 (0)