aboutsummaryrefslogtreecommitdiff
path: root/cmd-move-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-23 16:59:14 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-23 16:59:14 +0000
commit4d9af27b0bbb19466aecc9a39b9eb94796b2c7d8 (patch)
tree894030570ec55749b620e654ef17ec311e80f7f9 /cmd-move-window.c
parent3f171917f6bce0fd5eb808a11b80d550d2a7d249 (diff)
downloadrtmux-4d9af27b0bbb19466aecc9a39b9eb94796b2c7d8.tar.gz
rtmux-4d9af27b0bbb19466aecc9a39b9eb94796b2c7d8.tar.bz2
rtmux-4d9af27b0bbb19466aecc9a39b9eb94796b2c7d8.zip
Better error messages for fork.
Diffstat (limited to 'cmd-move-window.c')
-rw-r--r--cmd-move-window.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd-move-window.c b/cmd-move-window.c
index 65812b17..b7f02091 100644
--- a/cmd-move-window.c
+++ b/cmd-move-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-move-window.c,v 1.4 2009-01-19 18:23:40 nicm Exp $ */
+/* $Id: cmd-move-window.c,v 1.5 2009-01-23 16:59:14 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -50,6 +50,7 @@ cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct client *c;
u_int i;
int destroyed, idx;
+ char *cause;
if ((wl_src = cmd_find_window(ctx, data->src, &src)) == NULL)
return (-1);
@@ -91,9 +92,10 @@ cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx)
}
}
- wl_dst = session_attach(dst, wl_src->window, idx);
+ wl_dst = session_attach(dst, wl_src->window, idx, &cause);
if (wl_dst == NULL) {
- ctx->error(ctx, "index in use: %d", idx);
+ ctx->error(ctx, "attach window failed: %s", cause);
+ xfree(cause);
return (-1);
}