commit: 66c55f6efbed1e5fb3a5f431df5584c079e848d1
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 29 12:35:52 2025 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 12:37:21 2025 +0000
URL: https://gitweb.gentoo.org/proj/steve.git/commit/?id=66c55f6e
Fix unused `pid_fd`
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
steve.cxx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/steve.cxx b/steve.cxx
index 4c49e3f..4ebea86 100644
--- a/steve.cxx
+++ b/steve.cxx
@@ -219,13 +219,11 @@ static void steve_open(fuse_req_t req, struct
fuse_file_info *fi)
std::print(stderr, "Device open by PID {} (process name
unknown)\n", fi->fh);
}
- int pid_fd;
if (state->processes.find(fi->fh) != state->processes.end()) {
assert(state->processes[fi->fh].pid_fd != -1);
assert(state->processes[fi->fh].event);
- pid_fd = state->processes[fi->fh].pid_fd;
} else {
- pid_fd = syscall(SYS_pidfd_open, context->pid, 0);
+ int pid_fd = syscall(SYS_pidfd_open, context->pid, 0);
if (pid_fd == -1) {
perror("unable to open pidfd, rejecting to open");
fuse_reply_err(req, EIO);