Better error messages for fork.

This commit is contained in:
Nicholas Marriott
2009-01-23 16:59:14 +00:00
parent 3f171917f6
commit 4d9af27b0b
12 changed files with 77 additions and 56 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-split-window.c,v 1.7 2009-01-21 19:38:51 nicm Exp $ */
/* $Id: cmd-split-window.c,v 1.8 2009-01-23 16:59:14 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -140,8 +140,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window *w;
struct window_pane *wp;
const char *env[] = CHILD_ENVIRON;
char buf[256];
char *cmd, *cwd;
char buf[256], *cmd, *cwd, *cause;
u_int i, hlimit, lines;
if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
@ -168,8 +167,10 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
lines = (w->active->sy * data->percentage) / 100;
hlimit = options_get_number(&s->options, "history-limit");
if ((wp = window_add_pane(w, lines, cmd, cwd, env, hlimit)) == NULL) {
ctx->error(ctx, "command failed: %s", cmd);
wp = window_add_pane(w, lines, cmd, cwd, env, hlimit, &cause);
if (wp == NULL) {
ctx->error(ctx, "create pane failed: %s", cause);
xfree(cause);
return (-1);
}
server_redraw_window(w);