mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-18 17:38:53 +02:00
Better error messages for fork.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-link-window.c,v 1.27 2009-01-19 18:23:40 nicm Exp $ */
|
||||
/* $Id: cmd-link-window.c,v 1.28 2009-01-23 16:59:14 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@@ -47,6 +47,7 @@ cmd_link_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
struct cmd_srcdst_data *data = self->data;
|
||||
struct session *dst;
|
||||
struct winlink *wl_src, *wl_dst;
|
||||
char *cause;
|
||||
int idx;
|
||||
|
||||
if ((wl_src = cmd_find_window(ctx, data->src, NULL)) == NULL)
|
||||
@@ -89,9 +90,10 @@ cmd_link_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, "create session failed: %s", cause);
|
||||
xfree(cause);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user