summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-08-02 20:47:36 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-08-02 20:47:36 +0000
commitc2c3c7f0d73c9cd64b8896c27d4e6bb4f5662e84 (patch)
tree05db8e2902cf11483bcfd1ea83ee70e2e1d6b3ba /usr.bin
parente48e7c36eef05551e4522a223a781451b4f3f3a2 (diff)
Fix checking of setupterm(3) error codes. While there include the
name of the terminal type causing the error where relevant. ok nicm@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/tty-term.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c
index f86680b9ab7..d7dcf4fea4e 100644
--- a/usr.bin/tmux/tty-term.c
+++ b/usr.bin/tmux/tty-term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-term.c,v 1.3 2009/07/14 06:30:45 nicm Exp $ */
+/* $OpenBSD: tty-term.c,v 1.4 2009/08/02 20:47:35 matthieu Exp $ */
/*
* 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. */
if (setupterm(name, fd, &error) != OK) {
switch (error) {
- case 0:
- xasprintf(cause, "can't use hardcopy terminal");
- break;
case 1:
- xasprintf(cause, "missing or unsuitable terminal");
+ xasprintf(cause, "can't use hardcopy terminal: %s", name);
+ break;
+ case 0:
+ xasprintf(cause, "missing or unsuitable terminal: %s", name);
break;
- case 2:
+ case -1:
xasprintf(cause, "can't find terminfo database");
break;
default: