summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-01-20 14:02:33 +0000
committernicm <nicm@openbsd.org>2017-01-20 14:02:33 +0000
commit08cc55a3a92f846bc2d471172018fa6eb8c68e2e (patch)
tree9afabc906c50be6dcd38080cb2dea42b384f7d11
parentClosed SAs should never be treated as valid (diff)
downloadwireguard-openbsd-08cc55a3a92f846bc2d471172018fa6eb8c68e2e.tar.xz
wireguard-openbsd-08cc55a3a92f846bc2d471172018fa6eb8c68e2e.zip
Print error rather than fatal() if tcgetattr() fails, which is much more
useful to user.
-rw-r--r--usr.bin/tmux/client.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index 1e34b94b5e1..601f4e9c33c 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.117 2017/01/16 14:52:25 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.118 2017/01/20 14:02:33 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -313,8 +313,11 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
event_set(&client_stdin, STDIN_FILENO, EV_READ|EV_PERSIST,
client_stdin_callback, NULL);
if (client_flags & CLIENT_CONTROLCONTROL) {
- if (tcgetattr(STDIN_FILENO, &saved_tio) != 0)
- fatal("tcgetattr failed");
+ if (tcgetattr(STDIN_FILENO, &saved_tio) != 0) {
+ fprintf(stderr, "tcgetattr failed: %s\n",
+ strerror(errno));
+ return (1);
+ }
cfmakeraw(&tio);
tio.c_iflag = ICRNL|IXANY;
tio.c_oflag = OPOST|ONLCR;