#include <stdio.h>
#include <errno.h>
#include <string.h>
+#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <dirent.h>
+void pipe_handler (int sig) {
+ printf("SIGPIPE");
+}
+
int main(int argc, char **argv, char **envp)
{
if (argc<2) {
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]);
FD_SET(0, &set);
FD_SET(vfd0, &set);
- while (1) {
+ while (1)
+ {
int ret;
printf("vsys>");fflush(stdout);
FD_SET(0, &set);