aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepoch <epoch@hack.thebackupbox.net>2019-06-24 05:45:57 +0000
committerepoch <epoch@hack.thebackupbox.net>2019-06-24 05:45:57 +0000
commitac184f83e4786219103701c78ab82b188b093133 (patch)
tree161b0367fd7ab4b457f437855813ea0ccbfb73bf
parent142e7c78f554897079d977f99b909ab7d66da978 (diff)
downloadlibidc-ac184f83e4786219103701c78ab82b188b093133.tar.gz
libidc-ac184f83e4786219103701c78ab82b188b093133.zip
testing out select without reading
-rw-r--r--libidc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libidc.c b/libidc.c
index 6d82d44..f8bea62 100644
--- a/libidc.c
+++ b/libidc.c
@@ -181,10 +181,10 @@ int select_on_everything() {
if(idc.fds[i].fd == -1) continue;//skip -1s
if(!FD_ISSET(idc.fds[i].fd,&readfs)) continue;//did not find one. hurry back to the for loop
j--;//we found one. trying to get j==0 so we can get out of here early.
- //if(idc.fds[i].read_lines_for_us == 0) {
- // idc.fds[i].line_handler(&idc.fds[i],0);//the line pointer is null.
- // continue;//we don't need to read the line.
- //}
+ if(idc.fds[i].read_lines_for_us == 0) {
+ idc.fds[i].line_handler(&idc.fds[i],"");//the line pointer is null. which also is EOF? we'll know what it means.
+ continue;//we don't need to read the line.
+ }
fprintf(stderr,"attempting to read from fd: %d\n",idc.fds[i].fd);
if((n=read(idc.fds[i].fd,idc.fds[i].buffer,CHUNK)) < 0) {
snprintf(tmp,sizeof(tmp)-1,"fd %d: read perror:",idc.fds[i].fd);//hopefully this doesn't error and throw off error messages.