summaryrefslogtreecommitdiffstats
path: root/cmd-new-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-new-window.c
parent3f171917f6bce0fd5eb808a11b80d550d2a7d249 (diff)
Better error messages for fork.
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r--cmd-new-window.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c
index 921a47d6..76872b5a 100644
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-new-window.c,v 1.30 2009-01-21 22:21:49 nicm Exp $ */
+/* $Id: cmd-new-window.c,v 1.31 2009-01-23 16:59:14 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -120,7 +120,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct cmd_new_window_data *data = self->data;
struct session *s;
struct winlink *wl;
- char *cmd, *cwd;
+ char *cmd, *cwd, *cause;
int idx;
if (data == NULL)
@@ -168,9 +168,10 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
else
cwd = ctx->cmdclient->cwd;
- wl = session_new(s, data->name, cmd, cwd, idx);
+ wl = session_new(s, data->name, cmd, cwd, idx, &cause);
if (wl == NULL) {
- ctx->error(ctx, "command failed: %s", cmd);
+ ctx->error(ctx, "create window failed: %s", cause);
+ xfree(cause);
return (-1);
}
if (!data->flag_detached) {