mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Added handling for pipe closing.
svn path=/trunk/; revision=2928
This commit is contained in:
parent
eb12656476
commit
ad703f36f3
1 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: read.c,v 1.6 2002/05/07 22:32:13 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/msvcrt/io/read.c
|
||||
|
@ -22,7 +23,7 @@ size_t _read(int _fd, void *_buf, size_t _nbyte)
|
|||
DWORD _rbyte = 0, nbyte = _nbyte;
|
||||
char *bufp = (char*)_buf;
|
||||
HANDLE hfile;
|
||||
int istext;
|
||||
int istext, error;
|
||||
|
||||
DPRINT("_read(fd %d, buf %x, nbyte %d)\n", _fd, _buf, _nbyte);
|
||||
|
||||
|
@ -37,6 +38,11 @@ size_t _read(int _fd, void *_buf, size_t _nbyte)
|
|||
if (!ReadFile(hfile, bufp, nbyte, &_rbyte, NULL))
|
||||
{
|
||||
/* failure */
|
||||
error = GetLastError();
|
||||
if (error == ERROR_BROKEN_PIPE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue