| 34 | } |
| 35 | |
| 36 | ProcessInspector::ProcessSnapshot ResolveProcess(PID_t pid) { |
| 37 | if (auto cached = TryReuseCachedProcess(pid)) return *cached; |
| 38 | |
| 39 | // First sighting: inspect once and cache so sibling pipes reuse it. A dead |
| 40 | // process yields creationTime=0, so skip caching that junk key. |
| 41 | const ProcessInspector::ProcessSnapshot snapshot = ProcessInspector::InspectProcess(pid); |
| 42 | const ProcessKey processKey = MakeProcessKey(snapshot); |
| 43 | if (processKey.IsValid()) g_processes[processKey] = snapshot; |
| 44 | return snapshot; |
| 45 | } |
| 46 | |
| 47 | } // namespace |
| 48 |
no test coverage detected