Changeset 12522


Ignore:
Timestamp:
Aug 3, 2009, 3:36:52 AM (10 years ago)
Author:
gb
Message:

Handle EOF in read_pipe().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/windows-calls.c

    r12519 r12522  
    374374pipe_read(HANDLE hfile, void *buf, unsigned int count)
    375375{
    376   DWORD navail;
     376  DWORD navail, err;;
    377377
    378378  do {
    379379    navail = 0;
    380     PeekNamedPipe(hfile, NULL, 0, NULL, &navail, NULL);
     380    if (PeekNamedPipe(hfile, NULL, 0, NULL, &navail, NULL) == 0) {
     381      err = GetLastError();
     382      if (err = ERROR_HANDLE_EOF) {
     383        return 0;
     384      } else {
     385        _dosmaperr(err);
     386        return -1;
     387      }
     388    }
    381389    if (navail != 0) {
    382390      return lisp_standard_read(hfile, buf, count);
Note: See TracChangeset for help on using the changeset viewer.