removed timeout which caused vsyssh to spin in an infinite loop
[vsys.git] / vsyssh / vsyssh.c
index 586c6a7..889e41a 100644 (file)
@@ -39,8 +39,6 @@ int main(int argc, char **argv, char **envp)
                strcpy(outf,argv[1]);
                strcat(inf,".in");
                strcat(outf,".out");
-               tv.tv_sec = 100;
-               tv.tv_usec = 0;
 
                vfd1 = open(inf,O_WRONLY|O_NONBLOCK);
                vfd0 = open(outf,O_RDONLY|O_NONBLOCK);
@@ -59,24 +57,20 @@ int main(int argc, char **argv, char **envp)
                        while (1) {
                                int ret;
                                printf("vsys>");fflush(stdout);
-                               ret = select(vfd0+1, &set, NULL, NULL, &tv);
                                FD_SET(0, &set);
                                FD_SET(vfd0, &set);
+                               ret = select(vfd0+1, &set, NULL, NULL, NULL);
                                if (FD_ISSET(0,&set)) {
                                        char lineread[2048];
                                        int ret;
-                                       printf("Here\n");
                                        ret=read(0,lineread,2048);
                                        write(vfd1,lineread,ret);
                                        FD_CLR(0,&set);
-                               }
-                               if (FD_ISSET(vfd0,&set)) {
+                               } if (FD_ISSET(vfd0,&set)) {
                                        char lineread[2048];
                                        int ret;
-                                       printf("Here2\n");
                                        ret=read(vfd0,lineread,2048);
                                        write(1,lineread,ret);
-                                       printf("Here3\n");
                                        FD_CLR(vfd0,&set);
                                }
                        }