Handle ttyname(3) failure better.

This commit is contained in:
Nicholas Marriott 2009-08-08 16:05:01 +00:00
parent 06ddd3dcf8
commit 92cc3a6914

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]",