summaryrefslogtreecommitdiffstats
path: root/server-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-10-09 12:58:00 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-10-09 12:58:00 +0000
commit7aef2994e453df8e3cdd13e22e0041c9d7c23564 (patch)
treea7ac7c0d39bb3fef94e452f0a9f17873f2e363e3 /server-fn.c
parent08bcd6978cd6f699ec688dbea8c8a7ea43002e0c (diff)
Set cause when failing due to linking a window to itself, from Martin
Pieuchot.
Diffstat (limited to 'server-fn.c')
-rw-r--r--server-fn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server-fn.c b/server-fn.c
index a166541d..59f61373 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -280,8 +280,10 @@ server_link_window(struct session *src, struct winlink *srcwl,
if (dstidx != -1)
dstwl = winlink_find_by_index(&dst->windows, dstidx);
if (dstwl != NULL) {
- if (dstwl->window == srcwl->window)
+ if (dstwl->window == srcwl->window) {
+ xasprintf(cause, "same index: %d", dstidx);
return (-1);
+ }
if (killflag) {
/*
* Can't use session_detach as it will destroy session