comparison src/process.c @ 18946:84b78d90cd45

(wait_reading_process_input): Initialize total_read. Check for read_process_output giving back EIO.
author Richard M. Stallman <rms@gnu.org>
date Thu, 24 Jul 1997 16:58:05 +0000
parents 60f002497be1
children ded7c036e1ca
comparison
equal deleted inserted replaced
18945:7f491075707a 18946:84b78d90cd45
2335 if (wait_proc != 0 && !NILP (wait_proc->raw_status_low)) 2335 if (wait_proc != 0 && !NILP (wait_proc->raw_status_low))
2336 update_status (wait_proc); 2336 update_status (wait_proc);
2337 if (wait_proc != 0 2337 if (wait_proc != 0
2338 && ! EQ (wait_proc->status, Qrun)) 2338 && ! EQ (wait_proc->status, Qrun))
2339 { 2339 {
2340 int nread, total_nread; 2340 int nread, total_nread = 0;
2341 2341
2342 clear_waiting_for_input (); 2342 clear_waiting_for_input ();
2343 XSETPROCESS (proc, wait_proc); 2343 XSETPROCESS (proc, wait_proc);
2344 2344
2345 /* Read data from the process, until we exhaust it. */ 2345 /* Read data from the process, until we exhaust it. */
2346 while (XINT (wait_proc->infd) >= 0 2346 while (XINT (wait_proc->infd) >= 0
2347 && (nread 2347 && (nread
2348 = read_process_output (proc, XINT (wait_proc->infd)))) 2348 = read_process_output (proc, XINT (wait_proc->infd))))
2349 total_nread += nread; 2349 {
2350 if (0 < nread)
2351 total_nread += nread;
2352 #ifdef EIO
2353 else if (nread == -1 && EIO == errno)
2354 break;
2355 #endif
2356 }
2350 if (total_nread > 0 && do_display) 2357 if (total_nread > 0 && do_display)
2351 redisplay_preserve_echo_area (); 2358 redisplay_preserve_echo_area ();
2352 2359
2353 break; 2360 break;
2354 } 2361 }