summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorJuergen Weigert <jw@suse.de>2009-06-03 12:52:12 -0700
committerMicah Cowan <Micah Cowan micah@cowan.name>2009-06-03 12:52:12 -0700
commit230855a865ab209b9784ad3ecba8675d3df5ac32 (patch)
tree9399a1d44769e492ba9c20bd2cb4dffa1810bd9f /src/screen.c
parent9cdf8e20a271dea2c86d571d8ed457ecebbac14c (diff)
downloadscreen-230855a865ab209b9784ad3ecba8675d3df5ac32.tar.gz
Allow user to bypass sleep of 5 seconds.
When used as a minicom replacement, the hard coded sleep(5) is really annoying, when trying to find the correct line and parameters. This patch makes this fatal error message behave more like an ordinary message. We now honor msgwait variable and honors user input.
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c
index 5064652..ea8f83f 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1414,8 +1414,13 @@ char **av;
debug("We open one default window, as screenrc did not specify one.\n");
if (MakeWindow(&nwin) == -1)
{
- Msg(0, "Sorry, could not find a PTY.");
- sleep(5);
+ fd_set rfd;
+ struct timeval tv = { MsgWait/1000, 1000*(MsgWait%1000) };
+ FD_SET(0, &rfd);
+
+ Msg(0, "Sorry, could not find a PTY or TTY.");
+ // allow user to exit early by pressing any key.
+ select(1, &rfd, NULL, NULL, &tv);
Finit(0);
/* NOTREACHED */
}