Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion NotchBuddy/Sources/App/HookServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ final class HookServer: @unchecked Sendable {

while true {
let clientFD = Darwin.accept(fd, nil, nil)
guard clientFD >= 0 else { break }
guard clientFD >= 0 else {
// Never end the server on a failed accept (#853); pause unless it was transient
if errno != EINTR && errno != ECONNABORTED { usleep(100_000) }
continue
}
// Reject connections from other users (same-UID check)
var euid: uid_t = 0
var egid: gid_t = 0
Expand Down
4 changes: 4 additions & 0 deletions windows/src-tauri/src/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ pub fn start(app: AppHandle) {
};
loop {
if server.connect().await.is_err() {
// A failed instance never connects again (#853): listen on a fresh one.
if let Ok(fresh) = ServerOptions::new().create(&name) {
server = fresh;
}
tokio::time::sleep(Duration::from_millis(200)).await;
continue;
}
Expand Down