From 48fe341421279208e090f9d25794aa59a02de8ec Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 6 Apr 2020 06:03:32 -0500 Subject: added better error checking to not just assume EAGAIN --- share/hackvr/examples/hackvr_term/pty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'share/hackvr/examples/hackvr_term') diff --git a/share/hackvr/examples/hackvr_term/pty.c b/share/hackvr/examples/hackvr_term/pty.c index d894359..6903bc3 100644 --- a/share/hackvr/examples/hackvr_term/pty.c +++ b/share/hackvr/examples/hackvr_term/pty.c @@ -5,6 +5,7 @@ #include #include #include +#include int main(int argc,char *argv[]) { char *pts; @@ -56,12 +57,12 @@ int main(int argc,char *argv[]) { } switch(r=read(0,&in,1)) { case 0: eof1=1;;//EOF - case -1: break;//EAGAIN probably. + case -1: if(errno != EAGAIN) eof1=1; break;//EAGAIN probably. default: write(master,&in,r); } switch(r=read(master,&in,1)) { case 0: eof2=1;;//EOF - case -1: break;//EAGAIN probably + case -1: if(errno != EAGAIN) eof2=1; break;//EAGAIN probably default: write(1,&in,r); } usleep(100);//kek -- cgit v1.2.3