Changeset 4669
- Timestamp:
- Oct 6, 2010, 9:33:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/zzuf.c
r4667 r4669 944 944 tv.tv_usec = 1000; 945 945 946 #if _WIN32 947 for(i = 0; i < opts->maxchild; i++) 948 for (j = 0; j < 3; j++) 949 { 950 char tmpbuf[1025]; 951 int tmp = _read(opts->child[i].fd[j], tmpbuf, 1024); 952 if (tmp > 0) 953 { 954 tmpbuf[tmp] = 0; 955 fprintf(stderr, "read %i bytes on fd %i: \"%s\"\n", tmp, j, tmpbuf); 956 } 957 } 958 #endif 959 946 #if !defined _WIN32 947 /* Win32 does not support select() on non-sockets */ 960 948 errno = 0; 961 949 ret = select(maxfd + 1, &fdset, NULL, NULL, &tv); … … 964 952 if(ret <= 0) 965 953 return; 954 #endif 966 955 967 956 /* XXX: cute (i, j) iterating hack */ … … 973 962 continue; 974 963 964 #if !defined _WIN32 975 965 if(!ZZUF_FD_ISSET(opts->child[i].fd[j], &fdset)) 976 966 continue; 967 #endif 977 968 978 969 ret = read(opts->child[i].fd[j], buf, BUFSIZ - 1); … … 988 979 write((j < 2) ? STDERR_FILENO : STDOUT_FILENO, buf, ret); 989 980 } 981 #if !defined _WIN32 990 982 else if(ret == 0) 991 983 { … … 999 991 opts->child[i].status = STATUS_EOF; 1000 992 } 993 #endif 1001 994 } 1002 995 }
Note: See TracChangeset
for help on using the changeset viewer.