summaryrefslogtreecommitdiffstats
path: root/vncterm
diff options
context:
space:
mode:
Diffstat (limited to 'vncterm')
-rw-r--r--vncterm/LinuxVNC.c2
-rw-r--r--vncterm/VNConsole.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/vncterm/LinuxVNC.c b/vncterm/LinuxVNC.c
index 0905e74..bfff739 100644
--- a/vncterm/LinuxVNC.c
+++ b/vncterm/LinuxVNC.c
@@ -137,7 +137,7 @@ int main(int argc,char **argv)
sprintf(tty_device,"/dev/vcsa%d",tty);
#endif
- while(1) {
+ while(rfbIsActive(console->screen)) {
if(!console->currentlyMarking) {
tty_file=fopen(tty_device,"rb");
if(!tty_file) {
diff --git a/vncterm/VNConsole.c b/vncterm/VNConsole.c
index 651546a..ec3002f 100644
--- a/vncterm/VNConsole.c
+++ b/vncterm/VNConsole.c
@@ -328,7 +328,7 @@ char vcGetCh(vncConsolePtr c)
char vcGetChar(vncConsolePtr c)
{
- while(c->inputCount==0)
+ while(rfbIsActive(c->screen) && c->inputCount==0)
vcProcessEvents(c);
return(vcGetCh(c));
}
@@ -352,7 +352,8 @@ char *vcGetString(vncConsolePtr c,char *buffer,int bufferSize)
count=c->inputSize;
c->inputSize=bufferSize;
c->inputBuffer=buffer;
- while(c->inputCount<bufferSize-1 && buffer[c->inputCount-1]!='\n')
+ while(rfbIsActive(c->screen)
+ && c->inputCount<bufferSize-1 && buffer[c->inputCount-1]!='\n')
vcProcessEvents(c);
buffer[c->inputCount]=0;
c->inputBuffer=bufferBackup;
OpenPOWER on IntegriCloud