Changeset 33478
- Timestamp:
- Mar 11, 2012, 2:53:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
r33475 r33478 234 234 timeout.tv_usec = 500000; 235 235 236 int status = select (Nmax, &rdSet, &wtSet, NULL, &timeout);236 int status = select (Nmax, NULL, &wtSet, NULL, &timeout); 237 237 if (status == -1) { 238 238 perror("select()"); … … 251 251 // this host has waiting output : read to buffer, and dump if necessary 252 252 ReadtoIOBuffer (&table->hosts[i].stdout, table->hosts[i].stdio[HOST_STDOUT]); 253 if (table->hosts[i].stdout.Nbuffer > 0x10000) { 253 // if (table->hosts[i].stdout.Nbuffer > 0x10000) { 254 if (table->hosts[i].stdout.Nbuffer > 0x1000) { 254 255 fprintf (stdout, "--- stdout from %s ---\n", table->hosts[i].hostname); 255 256 write (STDOUT_FILENO, table->hosts[i].stdout.buffer, table->hosts[i].stdout.Nbuffer); 257 FlushIOBuffer (&table->hosts[i].stdout); 256 258 fprintf (stdout, "\n"); 257 259 } … … 261 263 // this host has waiting output : read to buffer, and dump if necessary 262 264 ReadtoIOBuffer (&table->hosts[i].stderr, table->hosts[i].stdio[HOST_STDERR]); 263 if (table->hosts[i].stderr.Nbuffer > 0x10000) { 265 // if (table->hosts[i].stderr.Nbuffer > 0x10000) { 266 if (table->hosts[i].stderr.Nbuffer > 0x1000) { 264 267 fprintf (stdout, "--- stderr from %s ---\n", table->hosts[i].hostname); 265 268 write (STDOUT_FILENO, table->hosts[i].stderr.buffer, table->hosts[i].stderr.Nbuffer); 269 FlushIOBuffer (&table->hosts[i].stderr); 266 270 fprintf (stdout, "\n"); 267 271 } … … 274 278 int pid = waitpid (-1, &status, WNOHANG); 275 279 if (!pid) { 280 // fprintf (stderr, "no hosts to harvest\n"); 281 usleep (500000); 276 282 break; // no outstanding jobs have finished 277 fprintf (stderr, "no hosts to harvest\n");278 usleep (500000);279 283 } 280 284 if ((pid == -1) && (errno == ECHILD)) goto escape; // no more jobs on which to wait … … 298 302 fprintf (stdout, "--- stdout from %s ---\n", table->hosts[j].hostname); 299 303 write (STDOUT_FILENO, table->hosts[j].stdout.buffer, table->hosts[j].stdout.Nbuffer); 304 FlushIOBuffer (&table->hosts[i].stdout); 300 305 fprintf (stdout, "\n"); 301 306 … … 304 309 fprintf (stdout, "--- stderr from %s ---\n", table->hosts[j].hostname); 305 310 write (STDOUT_FILENO, table->hosts[j].stderr.buffer, table->hosts[j].stderr.Nbuffer); 311 FlushIOBuffer (&table->hosts[i].stderr); 306 312 fprintf (stdout, "\n"); 307 313
Note:
See TracChangeset
for help on using the changeset viewer.
