Finished patching things.
[vsys.git] / vsyssh / vsyssh.c
index 889e41a..58625f5 100644 (file)
@@ -40,11 +40,13 @@ int main(int argc, char **argv, char **envp)
                strcat(inf,".in");
                strcat(outf,".out");
 
-               vfd1 = open(inf,O_WRONLY|O_NONBLOCK);
                vfd0 = open(outf,O_RDONLY|O_NONBLOCK);
+               printf("Out file: %d\n",vfd0);
+               vfd1 = open(inf,O_WRONLY);
+               printf("In file: %d\n",vfd1);
 
                if (vfd0==-1 || vfd1 == -1) {
-                       printf("Error opening vsys entry %s\n", argv[1]);
+                       printf("Error opening vsys entry %s (%s)\n", argv[1],strerror(errno));
                        exit(1);
                }
 
@@ -64,6 +66,8 @@ int main(int argc, char **argv, char **envp)
                                        char lineread[2048];
                                        int ret;
                                        ret=read(0,lineread,2048);
+                                       lineread[ret]='\0';
+                                       printf ("writing %s\n",lineread);
                                        write(vfd1,lineread,ret);
                                        FD_CLR(0,&set);
                                } if (FD_ISSET(vfd0,&set)) {