1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Sync OpenBSD patchset 210:

Fix checking of setupterm(3) error codes. While there include the
name of the terminal type causing the error where relevant. ok nicm@.
This commit is contained in:
Tiago Cunha 2009-08-09 12:06:25 +00:00
parent 80196c9abc
commit 75b6736cf4

View File

@ -1,4 +1,4 @@
/* $Id: tty-term.c,v 1.23 2009-07-14 06:54:38 nicm Exp $ */ /* $Id: tty-term.c,v 1.24 2009-08-09 12:06:25 tcunha Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -186,13 +186,13 @@ tty_term_find(char *name, int fd, char **cause)
/* Set up curses terminal. */ /* Set up curses terminal. */
if (setupterm(name, fd, &error) != OK) { if (setupterm(name, fd, &error) != OK) {
switch (error) { switch (error) {
case 0:
xasprintf(cause, "can't use hardcopy terminal");
break;
case 1: case 1:
xasprintf(cause, "missing or unsuitable terminal"); xasprintf(cause, "can't use hardcopy terminal: %s", name);
break; break;
case 2: case 0:
xasprintf(cause, "missing or unsuitable terminal: %s", name);
break;
case -1:
xasprintf(cause, "can't find terminfo database"); xasprintf(cause, "can't find terminfo database");
break; break;
default: default: