summaryrefslogtreecommitdiff
path: root/internal/eventloop.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-03-01 01:13:03 +0200
committerPaul Buetow <paul@buetow.org>2024-03-01 01:13:03 +0200
commitbd28618846796c865080231edb6bddb74caddff0 (patch)
tree808307ce88e75e44d0b27dafc3a2db5d8d680979 /internal/eventloop.go
parentdfaa92b076acfc341649888bef10116dc5f3e94e (diff)
also print Comm
Diffstat (limited to 'internal/eventloop.go')
-rw-r--r--internal/eventloop.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/eventloop.go b/internal/eventloop.go
index 37771ee..edfa980 100644
--- a/internal/eventloop.go
+++ b/internal/eventloop.go
@@ -41,13 +41,14 @@ func events(rawCh <-chan []byte) <-chan enterExitEvent {
if ev.is(SYS_ENTER_OPENAT, SYS_EXIT_OPENAT) || ev.is(SYS_ENTER_OPEN, SYS_EXIT_OPEN) {
openEnterEv := ev.enterEv.(*OpenEnterEvent)
fd := ev.exitEv.(*FdEvent).Fd
- file := file{fd, string(openEnterEv.Filename[:])}
+ // TODO: Comm can change based on thread. So refactor this to a comms map.
+ file := file{string(openEnterEv.Comm[:]), fd, string(openEnterEv.Filename[:])}
if fd >= 0 {
files[fd] = file
}
- ev.comm = string(openEnterEv.Comm[:])
ev.file = file
+ evCh <- ev
return
}
@@ -55,13 +56,12 @@ func events(rawCh <-chan []byte) <-chan enterExitEvent {
if file_, ok := files[fdEvent.Fd]; ok {
ev.file = file_
} else {
- ev.file = file{fdEvent.Fd, "?"}
+ ev.file = file{"?", fdEvent.Fd, "?"}
}
if ev.is(SYS_ENTER_CLOSE, SYS_EXIT_CLOSE) {
delete(files, fdEvent.Fd)
}
}
-
evCh <- ev
}