Changeset b020bb9
- Timestamp:
- 10/08/04 15:38:00 (18 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- a1c7b8e
- Parents:
- 725dc40
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
r83ac5a7 rb020bb9 404 404 buffer = malloc(len); 405 405 406 switch(libtrace->sourcetype) { 407 case SOCKET: 408 case RT: 409 // read from the network 410 if ((numbytes=recv(libtrace->input.fd, 411 buffer, 412 len, 413 MSG_NOSIGNAL)) == -1) { 414 perror("recv"); 415 return -1; 416 } 417 break; 418 case DEVICE: 419 if ((numbytes=read(libtrace->input.fd, 420 buffer, 421 len)) == -1) { 422 perror("read"); 423 return -1; 424 } 425 break; 426 default: 427 if ((numbytes=gzread(libtrace->input.file, 428 buffer, 429 len)) == -1) { 430 perror("gzread"); 431 return -1; 432 } 406 while(1) { 407 switch(libtrace->sourcetype) { 408 case SOCKET: 409 case RT: 410 // read from the network 411 if ((numbytes=recv(libtrace->input.fd, 412 buffer, 413 len, 414 MSG_NOSIGNAL)) == -1) { 415 if (errno == EINTR) { 416 // ignore EINTR in case 417 // a caller is using signals 418 continue; 419 } 420 perror("recv"); 421 return -1; 422 } 423 break; 424 case DEVICE: 425 if ((numbytes=read(libtrace->input.fd, 426 buffer, 427 len)) == -1) { 428 perror("read"); 429 return -1; 430 } 431 break; 432 default: 433 if ((numbytes=gzread(libtrace->input.file, 434 buffer, 435 len)) == -1) { 436 perror("gzread"); 437 return -1; 438 } 439 } 440 break; 433 441 } 434 442 return numbytes;
Note: See TracChangeset
for help on using the changeset viewer.