Changeset bc0078 in git for Singular/ssiLink.cc
- Timestamp:
- Mar 8, 2011, 11:52:46 AM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 8a9bcca97de899994799612c3fb8014a6b008467
- Parents:
- 9803fba33946bae0120952e8ec3363d37dd5bc1a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ssiLink.cc
r9803fb rbc0078 606 606 omFree(l->mode); 607 607 l->mode = omStrDup(mode); 608 608 singular_in_batchmode=TRUE; 609 609 SI_LINK_SET_RW_OPEN_P(l); 610 610 //myynest=0; … … 1170 1170 int c=fgetc(d->f_read); 1171 1171 //Print("try c=%d\n",c); 1172 if (c== -1) return "eof"; 1172 if (c== -1) return "eof"; /* eof or error */ 1173 1173 else if (isdigit(c)) 1174 1174 { ungetc(c,d->f_read); d->ungetc_buf='\1'; return "ready"; } … … 1196 1196 int slStatusSsiL(lists L, int timeout) 1197 1197 { 1198 // input: L: a list with snks of type1199 // s i-fork, ssi-tcp, MPtcp-fork or MPtcp-launch1198 // input: L: a list with links of type 1199 // ssi-fork, ssi-tcp, MPtcp-fork or MPtcp-launch 1200 1200 // timeout: timeout for select in micro-seconds 1201 1201 // or -1 for infinity … … 1262 1262 int s= select(max_fd, &mask, NULL, NULL, wt_ptr); 1263 1263 if (s==-1) return -2; /*error*/ 1264 int j; 1265 int retry_needed=0; 1266 find_next_fd: 1264 1267 if (s==0) 1265 1268 { 1266 return 0; /*poll: not ready */ 1267 } 1268 else /* s>0, at least one ready */ 1269 { 1270 int j=0; 1269 if (retry_needed) 1270 { 1271 // the os reported that one of the (ssi) links is ready, 1272 // but it was only white space: this cannot happen again: 1273 return slStatusSsiL(L,timeout); 1274 } 1275 else 1276 return 0; /*poll: not ready */ 1277 } 1278 else /* s>0, at least one ready (the number of fd which are ready is s)*/ 1279 { 1280 j=0; 1271 1281 while (j<=max_fd) { if (FD_ISSET(j,&mask)) break; j++; } 1272 1282 for(i=L->nr; i>=0; i--) … … 1302 1312 int c=fgetc(d->f_read); 1303 1313 //Print("try c=%d\n",c); 1304 if (c== -1) return 0; 1314 if (c== -1) /* eof or error*/ 1315 { 1316 retry_needed=1; 1317 FD_CLR(j,&mask); 1318 s--; 1319 goto find_next_fd; 1320 } 1305 1321 else if (isdigit(c)) 1306 1322 { ungetc(c,d->f_read); d->ungetc_buf='\1'; return i+1; }
Note: See TracChangeset
for help on using the changeset viewer.