summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-10-09 14:31:50 +0000
committerTiago Cunha <tcunha@gmx.com>2010-10-09 14:31:50 +0000
commitb2ae7c626164452d3a28b8acfce2493180387198 (patch)
treec3e7484773b02cee31d0e06f111fb2c64424de4d
parent6c9269baa784f7d9260cbcddab80e68a64298a56 (diff)
Sync OpenBSD patchset 770:
Set cause when failing due to linking a window to itself, from Martin Pieuchot.
-rw-r--r--server-fn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server-fn.c b/server-fn.c
index eb0f2bda..897a38f2 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -1,4 +1,4 @@
-/* $Id: server-fn.c,v 1.112 2010-10-09 14:31:14 tcunha Exp $ */
+/* $Id: server-fn.c,v 1.113 2010-10-09 14:31:50 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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