X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vsyssh%2Fvsyssh.c;h=0239fec948548d780807119f1d4c78b5d7c0234e;hb=f37863116494a4011988ad51100e6b956bcb4bd7;hp=58625f5ef38574e1eab220763587ee70476171c2;hpb=1a489047481c761be639e342c38326aeaca600f9;p=vsys.git diff --git a/vsyssh/vsyssh.c b/vsyssh/vsyssh.c index 58625f5..0239fec 100644 --- a/vsyssh/vsyssh.c +++ b/vsyssh/vsyssh.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,10 @@ #include #include +void pipe_handler (int sig) { + printf("SIGPIPE"); +} + int main(int argc, char **argv, char **envp) { if (argc<2) { @@ -33,6 +38,7 @@ int main(int argc, char **argv, char **envp) char *inf,*outf; struct timeval tv; + signal(SIGPIPE,pipe_handler); inf=(char *)malloc(strlen(argv[1])+3); outf=(char *)malloc(strlen(argv[1])+4); strcpy(inf,argv[1]); @@ -56,7 +62,8 @@ int main(int argc, char **argv, char **envp) FD_SET(0, &set); FD_SET(vfd0, &set); - while (1) { + while (1) + { int ret; printf("vsys>");fflush(stdout); FD_SET(0, &set);