summaryrefslogtreecommitdiff
path: root/runtime/session.zig
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/session.zig')
-rw-r--r--runtime/session.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/session.zig b/runtime/session.zig
index 60644aa6..5e99384e 100644
--- a/runtime/session.zig
+++ b/runtime/session.zig
@@ -188,6 +188,10 @@ pub fn Loop(comptime Frontend: type) type {
/// let go (host_io.restoreCore); its shells and the frontend's
/// devices with it.
fn restore(l: *L, path: []const u8) void {
+ // A pair's session no daemon keeps: a Restore lets every client
+ // go, and its one could not join it again (no socket finds it):
+ // refused, as its Upgrade is (tui.zig `upgradeNow`).
+ if (l.peers.count() > 0 and daemon.link < 0) return l.core.reportFailure(l.core.view().active, "Restore: no daemon keeps this session, so its client could not join it again; this session stays as it is");
const nc = host_io.restoreCore(l.gpa, l.core, path, &l.peers, l.watches.fd, &l.watches.table) orelse return;
l.fe.restoring(nc);
// The old core's pipes end, and an answer to its query is