More fixes for fenrir's self-voice and notification system. Make sure proper sockets can be accessed.

This commit is contained in:
Storm Dragon committed 2026-11-04 22:51:18 -05:00
1 parent c4e9cb4b75
commit 69b94d14c6
9 files changed
+514 -16

No files matched your search

+18 -2
View File
@@ -74,19 +74,35 @@ func (s *Server) route_target(pid, uid int) (string, error) {
}
}
seen := map[int]bool{}
var ancestors []int
var ancestorReader *instance
ancestry:
for ancestor := pid; ancestor > 1 && !seen[ancestor]; ancestor = parent_pid(ancestor) {
seen[ancestor] = true
ancestors = append(ancestors, ancestor)
for _, data := range terminals {
if data.PID == ancestor {
return s.destination(data)
ancestorReader = &data
break ancestry
}
}
for _, data := range consoles {
if data.PID == ancestor {
return s.destination(data)
ancestorReader = &data
break ancestry
}
}
}
readers := append(slices.Clone(terminals), consoles...)
if reader, handled, err := attached_screen_reader("/proc", ancestors, uid, readers); handled {
if err != nil {
return "", err
}
return s.destination(reader)
}
if ancestorReader != nil {
return s.destination(*ancestorReader)
}
identity := process_identity(pid, uid)
return s.route_identity(identity, uid, terminals, consoles)
}