Skip to content

Commit

Permalink
[lldb] Update NativeProcess*BSD to new Status API
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-prantl committed Aug 27, 2024
1 parent d48b0f8 commit 47667ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ static Status EnsureFDFlags(int fd, int flags) {

int status = fcntl(fd, F_GETFL);
if (status == -1) {
error.SetErrorToErrno();
error = Status::FromErrno();
return error;
}

if (fcntl(fd, F_SETFL, status | flags) == -1) {
error.SetErrorToErrno();
error = Status::FromErrno();
return error;
}

Expand Down Expand Up @@ -414,7 +414,7 @@ Status NativeProcessFreeBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
if (ret == -1) {
error = CanTrace();
if (error.Success())
error.SetErrorToErrno();
error = Status::FromErrno();
}

if (result)
Expand Down Expand Up @@ -523,7 +523,7 @@ Status NativeProcessFreeBSD::Halt() {
if (StateIsStoppedState(m_state, false))
return error;
if (kill(GetID(), SIGSTOP) != 0)
error.SetErrorToErrno();
error = Status::FromErrno();
return error;
}

Expand All @@ -544,7 +544,7 @@ Status NativeProcessFreeBSD::Signal(int signo) {
Status error;

if (kill(GetID(), signo))
error.SetErrorToErrno();
error = Status::FromErrno();

return error;
}
Expand Down
12 changes: 6 additions & 6 deletions lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ static Status EnsureFDFlags(int fd, int flags) {

int status = fcntl(fd, F_GETFL);
if (status == -1) {
error.SetErrorToErrno();
error = Status::FromErrno();
return error;
}

if (fcntl(fd, F_SETFL, status | flags) == -1) {
error.SetErrorToErrno();
error = Status::FromErrno();
return error;
}

Expand Down Expand Up @@ -391,7 +391,7 @@ Status NativeProcessNetBSD::StopProcess(lldb::pid_t pid) {
ret = kill(pid, SIGSTOP);

if (ret == -1)
error.SetErrorToErrno();
error = Status::FromErrno();

LLDB_LOG(log, "kill({0}, SIGSTOP)", pid);

Expand All @@ -412,7 +412,7 @@ Status NativeProcessNetBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
ret = ptrace(req, static_cast<::pid_t>(pid), addr, data);

if (ret == -1)
error.SetErrorToErrno();
error = Status::FromErrno();

if (result)
*result = ret;
Expand Down Expand Up @@ -576,7 +576,7 @@ Status NativeProcessNetBSD::Signal(int signo) {
Status error;

if (kill(GetID(), signo))
error.SetErrorToErrno();
error = Status::FromErrno();

return error;
}
Expand Down Expand Up @@ -612,7 +612,7 @@ Status NativeProcessNetBSD::Kill() {
}

if (kill(GetID(), SIGKILL) != 0) {
error.SetErrorToErrno();
error = Status::FromErrno();
return error;
}

Expand Down

0 comments on commit 47667ee

Please sign in to comment.