Handle ttyname(3) failure better.

pull/1/head
Nicholas Marriott 2009-08-08 16:05:01 +00:00
parent 06ddd3dcf8
commit 92cc3a6914
1 changed files with 2 additions and 1 deletions

View File

@ -72,9 +72,10 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx)
}
size += gd->hsize * sizeof *gd->linedata;
name = NULL;
if (wp->fd != -1)
name = ttyname(wp->fd);
else
if (name == NULL)
name = "unknown";
ctx->print(ctx,
" %s [%ux%u] [history %u/%u, %llu bytes]",